#include <bits/stdc++.h>
using namespace std;
#define int long long
//using namespace __gnu_pbds;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

void gen(int n, int m, int cnt, int& ans, vector<pair<int, int>> x) {
    /*cout << n << " " << m << " " << cnt << " ";
    for (auto e : x) {
        cout << e.first << " " << e.second << ", ";
    }
    cout << endl;*/
    if (cnt < 0) {
        return;
    }
    bool legit = true;
    for (auto e : x) {
        if (e != x[0]) {
            legit = false;
        }
    }
    if (legit) {
        ans = max(ans, m);
        return;
    }
    vector<pair<int, int>> nx = x;
    for (int i = 0; i < n; i++) {
        if (nx[i].second == 1) {
            if (nx[i].first == (m - 1)) {
                nx[i] = {m, -1};
            } else {
                nx[i].first += 1;
            }
        } else {
            if (nx[i].first == 2) {
                nx[i] = {1, 1};
            } else {
                nx[i].first -= 1;
            }
        }
    }
    gen(n, m, cnt - 1, ans, nx);
    int mx = m - 2;
    for (int i = 0; i < n; i++) {
        mx = min(mx, m - x[i].first);
    }
    for (int i = max(1ll, mx); i <= mx; i++) {
        //cout << n << " " << m << " " << cnt << " " << mx << endl;
        for (int j = 0; j < n; j++) {
            if (nx[j].first == (m - i)) {
                nx[j].second = -1;
            }
        }
        gen(n, m - i, cnt - 1, ans, nx);
    }
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t, n, m;
    cin >> t >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    string s;
    cin >> s;
    vector<pair<int, int>> x;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'R') {
            x.push_back({a[i], 1});
        } else {
            x.push_back({a[i], -1});
        }
    }
    int ans = -1;
    gen(n, m, 2050, ans, x);
    if (ans != -1) {
        cout << "Yes" << endl;
        if (t >= 2) {
            cout << ans << endl;
        }
    } else {
        cout << "No" << endl;
    }
}
