#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define sz(x) (int)(x.size())

constexpr int N = 1e7;
constexpr int inf = 1e18;
constexpr int mod = 998244353;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t, n, m;
    cin >> t >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    string s;
    cin >> s;
    if (a[0] == a[1]) {
        if (s[0] == s[1]) {
            cout << "Yes" << endl;
            if (t != 1) {
                cout << m << endl;
            }
            if (t == 3) {
                cout << 0 << endl;
            }
        } else {
            cout << "Yes" << endl;
            if (t != 1) {
                cout << a[0] << endl;
            }
            if (t == 3) {
                cout << 0 << ' ' << a[0] << endl;
            }
        }
        return 0;
    }
    if (a[0] > a[1]) {
        swap(a[0], a[1]);
        swap(s[0], s[1]);
    }
    int cnt = 0;
    if (s[0] == 'R' && s[1] == 'L') {
    } else {
        if (s[0] == 'L') {
            cnt = a[0] - 1;
        }
        if (s[1] == 'R') {
            cnt = max(cnt, m - a[1]);
        }
        if (s[0] == 'L') {
            a[0] = cnt - a[0] + 2;
        } else {
            a[0] += cnt;
        }
        if (s[1] == 'R') {
            a[0] = m - (cnt - (m - a[1]));
        } else {
            a[0] -= cnt;
        }
    }
    if ((a[1] - a[0]) % 2 == 1) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
        if (t != 1) {
            cout << (a[0] + a[1]) / 2 << endl;
        }
        if (t == 3) {
            cout << 1 << endl << cnt + (a[0] + a[1]) / 2 - a[0] << ' ' << (a[0] + a[1]) / 2 << endl;
        }
    }
    return 0;
}
