#include<bits/stdc++.h>

#define len(v) (int)v.size()
#define all(v) v.begin(), v.end()

using namespace std;
using ll = long long int;
using ld = long double;

void solve() {
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    vector<int> pos(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    string s;
    cin >> s;
    bool chet = false, nechet = false;
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'R') {
            pos[i] = a[i] - 1;
        } else {
            pos[i] = 2 * m - 1 - a[i];
        }
        if (pos[i] & 1) nechet = true;
        else chet = true;
    }
    if (chet && nechet) {
        cout << "No\n";
    } else {
        cout << "Yes\n";
    }
    vector<int> dists;
    sort(all(pos));
    for (int i = 0; i < len(pos); ++i) {
        int next = (i + 1) % len(pos);
        int dist = abs(pos[i] - pos[next]);
        m -= min(dist, 2 * m - 2 - dist) / 2;
    }
    cout << m << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
    }
}