#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 move(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 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) {
        if ((pos[0] <= pos[1] && s[0] == 'R' && s[1] == 'L') || (pos[1] <= pos[0] && s[0] == 'L' && s[1] == 'R')) {
            cout << "Yes\n";
            cout << (pos[0] + pos[1]) / 2;
            return;
        }
        int time = inf;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'R') {
                time = min(time, m - pos[i]);
            }else {
                time = min(time, pos[i] - 1);
            }
        }
        move(pos, s, time);
        cout << "Yes\n";
        cout << (pos[0] + pos[1]) / 2 << '\n';
        cout << "1\n";
        cout << abs(pos[0] - (pos[0] + pos[1]) / 2) << " " << (pos[0] + pos[1]) / 2;
        return;
    }
    if (T == 3) {
        if ((pos[0] <= pos[1] && s[0] == 'R' && s[1] == 'L') || (pos[1] <= pos[0] && s[0] == 'L' && s[1] == 'R')) {
            cout << "Yes\n";
            cout << (pos[0] + pos[1]) / 2 << '\n';
            cout << "1\n";
            cout << abs(pos[0] - (pos[0] + pos[1]) / 2) << " " << (pos[0] + pos[1]) / 2;
            return;
        }
        int time = inf;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'R') {
                time = min(time, m - pos[i]);
            }else {
                time = min(time, pos[i] - 1);
            }
        }
        move(pos, s, time);
        cout << "Yes\n";
        cout << (pos[0] + pos[1]) / 2 << '\n';
        cout << "1\n";
        cout << abs(time + abs(pos[0] - (pos[0] + pos[1]) / 2)) << " " << (pos[0] + pos[1]) / 2;
        return;
    }
}

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