#include <ctime>

#include "iostream"
#include "algorithm"
#include "vector"
#include "queue"
using namespace std;
#define int long long
#define all(arr) arr.begin(), arr.end()
#define _lg(x) (63 - __builtin_clzll(x))
constexpr int maxn = 200'010;
constexpr int mod = 1'000'000'007;
int arr[maxn]{};
int n, m;
int when_come(int x, int y, char dir1, char dir2) {
    if (x == y) return 0;
    if (x > y) return when_come(y, x, dir2, dir1);
    if (dir1 == 'R' && dir2 == 'L') {
        return (y - x) / 2;
    }
    if (dir1 == 'R' && dir2 == 'R') {
        return m - y + when_come(x + m - y, m, 'R', 'L');
    }
    if (dir1 == 'L' && dir2 == 'L') {
        return x - 1 + when_come(1, y - (x - 1), 'R', 'L');
    }
    if (dir1 == 'L' && dir2 == 'R') {
        int dist1 = x - 1;
        int dist2 = m - y;
        if (dist1 == dist2) {
            return dist1 + when_come(1, m, 'R', 'L');
        }
        if (dist1 < dist2) {
            return dist1 + when_come(1, y + dist1, 'R', 'R');
        }
        return dist2 + when_come(x - dist2, m, 'L', 'L');
    }
}
void solve() {
    int t;
    cin >> t >> n >> m;
    int x = 0;
    vector<int> have;
    for (int i = 0; i < n; i++) {
        int a; cin >> a;
        have.push_back(a);
        x |= (1 << (a & 1));
    }
    cout << (x == 3 ? "No" : "Yes") << '\n';
    if (x == 3) return;
    if (t == 1) return;
    string s; cin >> s;
    if (s[0] == s[1] && have[0] == have[1]) {
        cout << m << '\n';
        if (t == 3) {
            cout << 0;
            return;
        }
        return;
    }
    int timet = when_come(have[0], have[1], s[0], s[1]);
    int x1 = have[0];
    if (s[0] == 'L') {
        if (timet < have[0]) {
            x1 = have[0] - timet;
        } else {
            int delta = timet - (have[0] - 1);
            x1 = 1 + delta;
        }
    } else {
        if (have[0] + timet <= m) {
            x1 = have[0] + timet;
        } else {
            int delta = timet - (m - have[0]);
            x1 = m - delta;
        }
    }
    cout << max(x1, m + 1 - x1) << '\n';
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1; //cin >> t;
    while (t--) {
        solve();
    }
}