#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;

int t, n, m;
vector<int> a;
string s;
int mx = 0;

void rec(int now) {
    if (now >= 30) {
        return;
    }
    vector<int> was = a;
    string was1 = s;
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'R') {
            a[i]++;
            if (a[i] == m) {
                s[i] = 'L';
            }
        } else {
            --a[i];
            if (a[i] == 1) {
                s[i] = 'R';
            }
        }
    }
    string was2 = s;
    bool w = true;
    for (int i = 1; i < n; ++i) {
        if (a[i] != a[0]) w = false;
    }
    if (w) {
        mx = max(mx, a[0]);
    }
    int MX = *max_element(all(a));
    for (int newm = MX; newm <= m; ++newm) {
        int copym = m;
        m = newm;
        int kol = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] == m) {
                s[i] = 'L';
                ++kol;
            }
        }
        if (kol > 1) {
            rec(now + 1);
        }
        m = copym;
        a = was;
        s = was2;
    }
    a = was;
    s = was1;
}

void solve() {
    cin >> t >> n >> m;
    a.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    cin >> s;
    vector<int> pos(n);
    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";
        return;
    }
    cout << "Yes\n";
    rec(1);
    if (t >= 2) {
        cout << mx << "\n";
    }
}

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