#include <bits/stdc++.h>

using namespace std;
#define int long long

int n;

map<pair<pair<vector<int>, vector<int> >, int>, int> mp;

int rec(vector<int> s, vector<int> a, int curM) {
    for (int i = 0; i < n; i++) {
        if (a[i] + s[i] < 0 || a[i] + s[i] >= curM)
            s[i] *= -1;
    }
    if (mp[{{s, a}, curM}])
        return -1;
    mp[{{s, a}, curM}] = 1;
    bool good = true;
    for (int i = 0; i < n - 1; i++)
        if (a[i] != a[i + 1] || s[i] != s[i + 1])
            good = false;
    if (good) return curM;
    int ans = 1;
    if (*max_element(a.begin(), a.end()) < curM - 1) {
        ans = max(ans, rec(s, a, curM - 1));
    }else {
        for (int i = 0; i < n; i++)
            a[i] += s[i];
        ans = max(ans, rec(s, a, curM));
    }
    return ans;
}

vector<int> a, s;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int T, m;
    cin >> T >> n >> m;
    a.resize(n), s.resize(n);
    int c1 = 0, c2 = 0;
    string input;
    for (int i = 0; i < n; i++) cin >> a[i], a[i]--;
    cin >> input;
    for (int i = 0; i < n; i++)
        s[i] = (input[i] == 'L' ? -1 : 1);
    for (int i = 0; i < n; i++) {
        c1 += (a[i] % 2 == 0);
        c2 += (a[i] % 2 == 1);
    }
    if (c1 > 0 && c2 > 0) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    if (T == 1) return 0;
    while (a[0] != a[1]) {
        a[0] += s[0], a[1] += s[1];
        for (int i = 0; i < n; i++) {
            if (a[i] + s[i] < 0 || a[i] + s[i] >= m)
                s[i] *= -1;
        }
    }
    cout << a[0] + 1;
    return 0;
}
