#include<bits/stdc++.h>

#define len(v) (int)v.size()
#define all(v) v.begin(), v.end()

using namespace std;
using ll = long long int;
using ld = long double;

void solve() {
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    vector<int> pos(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    string s;
    cin >> s;
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'R') {
            pos[i] = a[i] - 1;
        } else {
            pos[i] = 2 * m - 1 - a[i];
        }
    }
    if (abs(pos[0] - pos[1]) % 2 == 0) {
        cout << "Yes\n";
        int add = 2 * (m - 1) - pos[0];
        int dist = abs(pos[0] - pos[1]);
        int mn = min(dist, 2 * m - 2 - dist);
        if (t >= 2) {
            cout << m - (mn / 2) << "\n";
        }
        if (t >= 3) {
            int newpos0 = (pos[0] + add) % (2 * m - 2);
            int newpos1 = (pos[1] + add) % (2 * m - 2);
            int add1 = 0;
            if (newpos1 < m - 1) {
                add1 += (m - 1) - (mn / 2);
            } else {
                add1 += (m - 1) + (mn / 2);
            }
            add1 += 2 * (m - 1);
            add1 %= (2 * (m - 1));
            cout << "1\n";
            cout << (add + add1) % (2 * (m - 1)) << " " << m - (mn / 2) << "\n";
        }
    } else {
        cout << "No\n";
        return;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
    }
}