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

using namespace std;

typedef long long ll;
typedef long double ld;

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

const int inf = 1e18L;
const int mod = 998244353;
const int maxn = 2e5L + 10;

int n, m;

void jmove(vector<int> &pos, string &s, int time) {
    for (int i = 0; i < n; i++) {
        pos[i] += time * (s[i] == 'R' ? 1 : -1);
        if (pos[i] == m) {
            s[i] = 'L';
        }
        if (pos[i] == 1) {
            s[i] = 'R';
        }
    }
}

void move(vector<int> &pos, string &s, int time) {
    while (time) {
        int tm = -inf;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'R') {
                tm = min(tm, m - pos[i]);
            } else {
                tm = min(tm, pos[i] - 1);
            }
        }
        if (time <= tm) {
            jmove(pos, s, time);
            break;
        }
        jmove(pos, s, tm);
        time -= tm;
    }
}

vector<int> move_(vector<int> pos, string s, int time) {
    while (time) {
        int tm = -inf;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'R') {
                tm = min(tm, m - pos[i]);
            } else {
                tm = min(tm, pos[i] - 1);
            }
        }
        if (time <= tm) {
            jmove(pos, s, time);
            break;
        }
        jmove(pos, s, tm);
        time -= tm;
    }
    return pos;
}

int get(vector<int> pos, string s) {
    ll res = 0;
    if (pos[0] == pos[1]) jmove(pos, s, 1), res = 1;
    while (true) {
        if (pos[0] <= pos[1] && s[0] == 'R' && s[1] == 'L') {
            return res + abs(pos[0] - pos[1]) / 2;
        }
        if (pos[1] <= pos[0] && s[0] == 'L' && s[1] == 'R') {
            return res + abs(pos[0] - pos[1]) / 2;
        }
        int tm = -inf;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'R') {
                tm = min(tm, m - pos[i]);
            } else {
                tm = min(tm, pos[i] - 1);
            }
        }
        jmove(pos, s, tm);
        res += tm;
    }
}

void solve() {
    int T;
    cin >> T >> n >> m;
    vector<int> pos(n);
    for (int i = 0; i < n; i++) cin >> pos[i];
    string s;
    cin >> s;
    if (abs(pos[0] - pos[1]) & 1) {
        cout << "No";
        return;
    }
    if (T == 1) {
        cout << "Yes\n";
        return;
    }
    if (T == 2) {
        int time_to_meet = 0;
        if (pos[0] == pos[1] && s[0] == s[1]) {
            cout << "Yes\n";
            cout << m;
            return;
        }
        time_to_meet = get(pos, s);
        move(pos, s, time_to_meet);
        if (pos[0] > move_(pos, s, m - 1)[0]) {
            cout << "Yes\n";
            cout << pos[0];
        } else {
            move(pos, s, m - 1);
            cout << "Yes\n";
            cout << pos[0];
        }
        return;
    }
    if (T == 3) {
        int time_to_meet = 0;
        if (pos[0] == pos[1] && s[0] == s[1]) {
            cout << "Yes\n";
            cout << m << '\n';
            cout << "0";
            return;
        }
        time_to_meet = get(pos, s);
        move(pos, s, time_to_meet);
        if (pos[0] > move_(pos, s, m - 1)[0]) {
            cout << "Yes\n";
            cout << pos[0] << '\n';
            cout << "1\n";
            cout << time_to_meet << " " << pos[0];
        } else {
            move(pos, s, m - 1);
            cout << "Yes\n";
            cout << pos[0] << '\n';
            cout << "1\n";
            cout << time_to_meet + m - 1 << " " << pos[0];
        }
        return;
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
        cout << '\n';
    }
}
