#include <bits/stdc++.h>
using namespace std;

const int MOD = 998244353, maxn = 1e6, inf = 1e9 + 7;
mt19937 rnd(55);
#define int long long

int tme[maxn], a[maxn];
int l[maxn], r[maxn];
int n, m;

void sixsevenbrainsrotted() {
    int T;
    cin >> T;
    cin >> n >> m;
    int fl1 = 1, fl2 = 1;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        fl1 &= (a[i] % 2 == 1);
        fl2 &= (a[i] % 2 == 0);
    }
    string s;
    cin >> s;
    if (fl1 || fl2) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
        return;
    }
    if (T == 1) return;
    vector<int> aboba;
    for (int i = 0; i < n; i++) {
        aboba.push_back(a[i] * (s[i] == 'R' ? 1 : -1));
    }
    sort(aboba.begin(), aboba.end());
    aboba.resize(unique(aboba.begin(), aboba.end()) - aboba.begin());
    int n = aboba.size();
    if (n == 1) {
        cout << m << "\n";
        if (T == 2) return;
        cout << "0\n";
        return;
    }
    if (n == 2) {
        int col = abs(aboba[0] - aboba[1]) / 2;
        if (col * 2 >= m) {
            col = m - col + 1;
        }
        cout << m - col + 1 << '\n';
        col = m - col + 1;
        if (T == 2) return;
        cout << "1\n";
        if (aboba[0] < 0) cout << (abs(aboba[0]) - 1 + (col - 1)) << ' ' << col << "\n";
        else {
            cout << (m - aboba[0]) + (m - 1) + (col - 1) << ' ' << col << "\n";
        }
        return;
    }
    aboba.push_back(aboba[0]);
    int ploho = m;
    for (int i = 0; i < n; i++) {
        continue;
    }
    int col = (int) aboba.size() - 1;
    cout << ploho << '\n';
    if (T == 2) return;
    /*for (int _ = 0; _ < col; _++) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {

            }
        }
    }*/
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int tests = 1;
    while (tests--) {
        sixsevenbrainsrotted();
    }
}
