#include <bits/stdc++.h>

using namespace std;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    bool f1 = false, f2 = false;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] % 2 == 0) f1 = true;
        else f2 = true;
    }
    if (f1 and f2) {
        cout << "No";
        return 0;
    }
    cout << "Yes" << '\n';
    if (t == 1) return 0;
    string s;
    cin >> s;
    set<int> del;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'L') {
            del.insert(a[i] - 1);
        } else {
            if (a[i] > 1) del.insert(m - 1 + m - a[i]);
            else del.insert(0);
        }
    }
    int res = m;
    vector<int> del2;
    for (auto x : del) del2.push_back(x);
    if (del2.size() > 2) {
        cout << 1 / 0;
    }
    for (int i = 1; i < del2.size(); i++) {
        res -= (del2[i] - del2[i - 1]) / 2;
    }
    cout << res << '\n';
    if (t == 2) return 0;
}