#include <bits/stdc++.h>

using namespace std;

#define int long long
#define pb push_back
#define ff first
#define ss second

int n, m;

bool check(vector<int> &a) {
    for (int i = 0; i < n - 1; i++) {
        if (abs(a[i] - a[i + 1]) % 2 == 1) return false;
    }
    return true;
}

void solve() {
    int t;
    cin >> t;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    string s;
    cin >> s;
    if (t == 1) {
        if (check(a)) cout << "Yes";
        else cout << "No";
        return;
    }
    if (!check(a)) {
        cout << "No";
        return;
    } else cout << "Yes" << "\n";
    if (a[0] == a[1]) {
        cout << n;
        if (t == 3) cout << "\n" << 0;
        return;
    }
    if (s[0] == 'R' && s[1] == 'R') {
        if (t == 2) {
            cout << m - (a[0] + a[1]) / 2;
            return;
        } else {
            cout << m - (a[0] + a[1]) / 2 << "\n";
            cout << 1 << "\n" << (m - a[0] + m - a[1]) / 2 << " " << m - (a[0] + a[1]) / 2;
            return;
        }
    } else if (s[0] == 'R' && s[1] == 'L' && a[0] < a[1]) {
        if ((a[0] + a[1]) / 2 > m - (a[0] + a[1]) / 2) {
            cout << (a[0] + a[1]) / 2 << "\n";
            if (t == 3) {
                cout << 1 << "\n" << abs(a[0] - a[1]) / 2 << " " << (a[0] + a[1]) / 2;
                return;
            }
        } else {
            cout << m - (a[0] + a[1]) / 2 << "\n";
            if (t == 3) {
                cout << 1 << "\n" << (m + a[1] + m - a[0]) / 2 << " " << m - (a[0] + a[1]) / 2;
            }
            return;
        }
    }
}

signed main() {
//    freopen("input.txt", "rb", stdin);
//    freopen("output.txt", "wb", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
//    cin >> t;
    while (t--) solve();
}
