#include<bits/stdc++.h>

using namespace std;

using ll = long long;

#define f first
#define s second
#define pii pair<int, int>


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    int f0 = 0, f1 = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        if (a[i] % 2 == 0) {
            f0 = 1;
        } else {
            f1 = 1;
        }
    }
    string s;
    cin >> s;
    if (f0 && f1) {
        cout << "No";
        exit(0);
    }
    cout << "Yes\n";
    if (t == 1) exit(0);
    if (a[0] > a[1]) {
        swap(a[0], a[1]);
        swap(s[0], s[1]);
    }
    if (a[0] == a[1]) {
        if (t == 2) {
            cout << m;
            exit(0);
        }
        cout << m << "\n" << 0;
        exit(0);
    }
    if (s[0] == 'L' && s[1] == 'R') {
        int mid = (a[0] + a[1]) / 2;
        int tm = mid - a[0];
        if (m + 1 - mid >= mid) {
            mid = m + 1 - mid;
            tm += m - 1;
        }
        cout << mid << "\n";
        if (t == 3) {
            cout << 1 << "\n" << tm << " " << mid;
        }
        exit(0);
    }


}

