//#pragma GCC optimize("O3,unroll-loops")
///#pragma GCC optimize("Ofast")
#include <vector>
//#pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;

#define int long long
using ld = long double;

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());

int mod = 998244353;

int binpow(int x, int n) {
    if (n == 0) {
        return 1;
    }
    if (n % 2 == 0) {
        return binpow(x*x%mod, n/2);
    }
    return binpow(x*x%mod, n/2) * x % mod;
}

struct Node {
    int x;
};

const int MAXN = 5 * 1e5;
vector <int> segtree(MAXN*4, -1);
vector <int> sum_push(MAXN*4, 0);
vector <int> dp(MAXN, -1);

int mergeupd(int ansl, int ansr) {
    return max(ansl, ansr);
}

int mergeget(int g1, int g2) {
    return max(g1, g2);
}

void push(int v) {
    segtree[v*2+1] += sum_push[v];
    segtree[v*2+2] += sum_push[v];
    sum_push[v*2+1] += sum_push[v];
    sum_push[v*2+2] += sum_push[v];
    sum_push[v] = 0;
}

void build(int v, int l, int r) {
    if (r - l == 1) {
        segtree[v] = dp[l];
        return;
    }
    int mid = (r+l)/2;
    build(v*2+1, l, mid);
    build(v*2+2, mid, r);
    segtree[v] = mergeupd(segtree[v*2+1], segtree[v*2+2]);
}

void update(int ql, int qr, int x, int v, int l, int r) {
    if (ql <= l && r <= qr) {
        segtree[v] += x;
        sum_push[v] += x;
        return;
    }
    if (qr <= l || r <= ql) {
        return;
    }
    int mid = (r+l)/2;
    push(v);
    update(ql, qr, x, v*2+1, l, mid);
    update(ql, qr, x, v*2+2, mid, r);
    segtree[v] = mergeupd(segtree[v*2+1], segtree[v*2+2]);
}

int get(int ql, int qr, int v, int l, int r) {
    if (ql <= l && r <= qr) {
        return segtree[v];
    }
    if (qr <= l || r <= ql) {
        return -1;
    }
    int mid = (r+l)/2;
    push(v);
    auto g1 = get(ql, qr, v*2+1, l, mid);
    auto g2 = get(ql, qr, v*2+2, mid, r);
    return mergeget(g1, g2);
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int n, m;
    int t;
    cin >> t;
    cin >> n;
    cin >> m;
    vector <int> v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    string s;
    cin >> s;
    sort(v.begin(), v.end());
    bool b1 = 0, b2 = 0;
    for (int i = 0; i < n; i++) {
        if (v[i] % 2 == 0) {
            b2 = 1;
        } else {
            b1 = 1;
        }
    }
    for (int i = 0; i < 1e9; i++) {
        m++;
    }
    if (b1 && b2) {
        cout << "No";
        return 0;
    } else {
        cout << "Yes" << '\n';
        if (t == 1) {
            return 0;
        }
        if (m == 1) {
            cout << 1 << '\n';
            if (t == 3) {
                cout << 0;
            }
            return 0;
        }
        int tim = 0;
        int a, b;
        a = v[0];
        b = v[1];
        if (a == b) {
            cout << m << '\n';
            if (t == 3) {
                cout << 0;
            }
            return 0;
        }
        if (a > b) {
            swap(a, b);
            swap(s[0], s[1]);
        }
        if (s[0] == s[1]) {
            if (s[0] == 'R') {
                int k = m - max(a, b);
                a += k;
                b += k;
                tim += k;
            } else {
                int k = min(a, b) - 1;
                a -= k;
                b -= k;
                tim += k;
            }
        } else {
            if (s[0] == 'L' && a < b) {
                int k = max(m - b, a - 1);
                a -= k;
                b += k;
                tim += k;
                if (a < 1) {
                    a = 2 - a;
                }
                if (b > m) {
                    b = m*2 - b;
                }
            }
        }
        int k = (a+b)/2;
        tim += abs(k-a);
        if (k >= m/2+1) {
            cout << k << '\n';
            if (t == 3) {
                cout << 1 << '\n';
                cout << tim << " " << k;
            }
            return 0;
        }
        tim += m - k;
        a = m;
        b = m - 2 * k + 2;
        k = (a+b)/2;
        tim += abs(k-a);
        cout << k << '\n';
        if (t == 3) {
            cout << 1 << '\n';
            cout << tim << " " << k;
        }
        return 0;
    }
    return 0;
}
