#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;

// #pragma GCC optimize("O3")
// #pragma GCC target("avx2")
// #pragma GCC optimize("unroll-loops")

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void solve() {
    ll type;
    cin >> type;
    ll n, m;
    cin >> n >> m;
    vector<ll> a(n);
    for (ll i = 0; i < n; i++) {
        cin >> a[i];
    }
    string s;
    cin >> s;
    set<pair<ll, char>> st;
    for (ll i = 0; i < n; i++) {
        st.insert({a[i], s[i]});
    }
    for (ll i = 0; i < n - 1; i++) {
        ll d;
        if (s[i] == 'R') {
            if (s[i + 1] == 'R') {
                if (a[i + 1] >= a[i]) {
                    d = a[i + 1] - a[i];
                } else {
                    d = m - a[i] + m + a[i + 1];
                }
            } else {
                d = m - a[i] + m - a[i + 1];
            }
        } else {
            if (s[i + 1] == 'L') {
                if (a[i + 1] <= a[i]) {
                    d = a[i] - a[i + 1];
                } else {
                    d = a[i] + m + m - a[i + 1];
                }
            } else {
                d = a[i] + a[i + 1];
            }
        }
        if (d % 2 == 1) {
            cout << "No";
            return;
        }
    }
    cout << "Yes\n";
    if (type == 1) {
        return;
    }
    if (n == 2) {
        if (s[0] == s[1] && a[0] == a[1]) {
            if (type == 2) {
                cout << m;
                return;
            }
            cout << m << '\n' << 0;
            return;
        }
        sort(a.begin(), a.end());
        ll t = 0;
        if (s[0] == s[1]) {
            if (s[0] == 'R') {
                t = m - a[1];
                a[0] += t;
                a[1] = m;
                s[1] = 'L';
            } else {
                t = a[0];
                a[0] = 1;
                a[1] -= t;
                s[0] = 'R';
            }
        }
        ll mi = -1;
        ll ti = -1;
        if (s[1] == 'L') {
            ll d = (a[1] - a[0]) / 2;
            ti = t + d;
            ll toch = a[0] + d;
            mi = max(toch, m - toch + 1);
            a[1] = toch;
            a[0] = toch;

            t += max(a[0], m - a[1]);
            a[0] = 1 + t - a[0];
            a[1] = m - (t - m + a[1]);
            d = (a[1] - a[0]) / 2;
            if (max(a[0] + d, m - a[0] - d - 1) > mi) {
                ti = t + d;
                toch = a[0] + d;
                mi = max(toch, m - toch + 1);
            }
        } else {
            t += max(a[0], m - a[1]);
            a[0] = 1 + t - a[0];
            a[1] = m - (t - m + a[1]);
            ll d = (a[1] - a[0]) / 2;
            ti = t + d;
            ll toch = a[0] + d;
            mi = max(toch, m - toch + 1);
            a[1] = toch;
            a[0] = toch;

            t += max(a[0], m - a[1]);
            a[0] = 1 + t - a[0];
            a[1] = m - (t - m + a[1]);
            d = (a[1] - a[0]) / 2;
            if (max(a[0] + d, m - a[0] - d - 1) > mi) {
                ti = t + d;
                toch = a[0] + d;
                mi = max(toch, m - toch + 1);
            }
        }
        if (type == 2) {
            cout << mi << '\n';
            return;
        }
        cout << mi << '\n' << "1\n" << ti << " " << mi << '\n';
    }
}

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