#include <bits/stdc++.h>

using namespace std;
#define int long long

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int T, n, m;
    cin >> T >> n >> m;
    int a[n], s[n], c1 = 0, c2 = 0;
    string input;
    for (int i = 0; i < n; i++) cin >> a[i], a[i]--;
    cin >> input;
    for (int i = 0; i < n; i++)
        s[i] = (input[i] == 'L' ? -1 : 1);
    for (int i = 0; i < n; i++) {
        c1 += (a[i] % 2 == 0);
        c2 += (a[i] % 2 == 1);
    }
    if (c1 > 0 && c2 > 0) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    if (T == 1) return 0;
    cout << (m + 1) / 2 << "\n";
    if (T == 2) return 0;
    cout << "1\n";
    cout << (m + 1) / 2 - 1 << " " << (m + 1) / 2 << "\n";
    return 0;
    while (true) {
        for (int itt = 0; itt < n; itt++) {
            for (int i = 0; i < n; i++)
                if ((a[i] == 0 && s[i] == -1) || (a[i] == m - 1 && s[i] == 1))
                    s[i] *= -1;
            bool good = false;
            for (int i = 0; i < n - 1; i++)
                if (a[i] != a[i + 1])
                    good = true;
            for (int i = 0; i < n - 1; i++)
                if (s[i] != s[i + 1])
                    good = true;
            if (!good) {
                cout << m;
                return 0;
            }
            for (int i = 0; i < n; i++)
                a[i] += s[i];
        }
        while (*max_element(a, a + n) == m - 1) {
            for (int i = 0; i < n; i++)
                if ((a[i] == 0 && s[i] == -1) || (a[i] == m - 1 && s[i] == 1))
                    s[i] *= -1;
            bool good = false;
            for (int i = 0; i < n - 1; i++)
                if (a[i] != a[i + 1])
                    good = true;
            for (int i = 0; i < n - 1; i++)
                if (s[i] != s[i + 1])
                    good = true;
            if (!good) {
                cout << m;
                return 0;
            }
            for (int i = 0; i < n; i++)
                a[i] += s[i];
        }
        m--;
    }
    return 0;
}
