#include <bits/stdc++.h>

using namespace std;
#define int long long

const int N = 210000;

int T, n, m, a[N];
string s;

int32_t main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> T >> n >> m;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    cin >> s;
    for (int i = 1; i <= n; i++) {
        if (s[i - 1] == 'L')
            a[i] = m - a[i];
        else
            a[i] = m + a[i] - 2;
    }
    int k = 2 * m - 2;
    set<int> st;
    for (int i = 1; i <= n; i++)
        st.insert(a[i]);
    vector<int> vec;
    int last = -1;
    for (int x : st) {
        if (last != -1) {
            if ((x - last) % 2 == 1) {
                cout << "No";
                return 0;
            }
            vec.push_back(x - last);
        }
        last = x;
    }
    vec.push_back(*st.begin() - last);
    cout << "Yes\n";
    if (T == 1) return 0;
    cout << (*max_element(begin(vec), end(vec)) + 2) / 2;
}