#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pii pair<int, int>
#define ff first
#define ss second
#define ld long double
#define pb push_back
#define ins insert
#define str string
#define int ll

mt19937 rnd(1488);

void solve(){
    int T;
    cin >> T;
    int n, m;
    cin >> n >> m;
    vector<int> cl;
    vector<int> cr;
    vector<int> c(n);
    for (int i = 0; i < n; i++){
        cin >> c[i];
    }
    str s;
    cin >> s;
    for (int i = 0; i < n; i++){
        if (s[i] == 'L'){
            cl.pb(c[i]);
        }
        else{
            cr.pb(c[i]);
        }
    }
    if (cl.size()){
        for (auto i:cl){
            if (i % 2 != cl[0] % 2){
                cout << "No\n";
                return;
            }
        }
        if (cr.size()){
            for (auto i:cr){
                if (i % 2 != cl[0] % 2){
                    cout << "No\n";
                    return;
                }
            }
        }
    }
    if (cr.size()){
        for (auto i:cr){
            if (i % 2 != cr[0] % 2){
                cout << "No\n";
                return;
            }
        }
    }
    cout << "Yes\n";
    int t;
    int ans;
    if (c[0] == c[1]){
        if (s[0] == s[1]){
            if (T >= 2){
                cout << m << "\n";
            }
            if (T >= 3){
                cout << "0\n";
            }
        }
        else{
            if (T >= 2){
                if (c[0] > m - c[0] + 1){
                    t = c[0];
                    cout << c[0] << "\n";
                    ans = c[0];
                }
                else{
                    t = m;
                    ans = m - c[0] + 1;
                    cout << m - c[0] + 1 << "\n";
                }
            }
            if (T >= 3){
                cout << 1 << "\n" << t << " " << ans << "\n";
            }
        }
        return;
    }
    if (T >= 2){
        if (s[0] == 'L'){
            if (s[1] == 'L'){
                sort(all(c));
                int t1 = (c[0] - 1 + c[1] - 1) / 2;
                int k1 = t1 - c[0] + 2;
                int k2 = m - k1 + 1;
                if (k1 > k2){
                    t = t1;
                    ans = k1;
                    cout << k1 << "\n";
                }
                else{
                    ans = k2;
                    t = c[0] - 1 + k2 - 1;
                    cout << k2 << "\n";
                }
            }
            else{
                if (c[0] < c[1]){
                    t = (c[0] - 1 + m - c[1] + m - 1) / 2;
                    ans = t - c[0] + 2;
                    cout << t - c[0] + 2 << "\n";
                }
                else{
                    sort(all(c));
                    t = (c[1] - c[0]) / 2;
                    ans = (c[0] + c[1]) / 2;
                    cout << (c[0] + c[1]) / 2 << "\n";
                }
            }
        }
        else if (s[1] == 'L'){
            swap(s[0], s[1]);
            swap(c[0], c[1]);
            if (c[0] < c[1]){
                t = (c[0] - 1 + m - c[1] + m - 1) / 2;
                ans = t - c[0] + 2;
                cout << t - c[0] + 2 << "\n";
            }
            else{
                sort(all(c));
                t = (c[1] - c[0]) / 2;
                ans = (c[0] + c[1]) / 2;
                cout << (c[0] + c[1]) / 2 << "\n";
            }
        }
        else{
            assert(0);
            sort(all(c));
            int t1 = (m - c[1] + m - c[0]) / 2;
            int k1 = t1 + c[0];
            int k2 = m - k2 + 1;
            if (k1 > k2){
                t = t1;
                ans = k1;
                cout << k1 << "\n";
            }
            else{
                t = k2 - c[0];
                ans = k2;
                cout << k2 << "\n";
            }
        }
    }
    if (T >= 3){
        cout << 1 << "\n" << t << " " << ans << "\n";
    }
}

int32_t main(){
    cin.tie(0)->ios_base::sync_with_stdio(0);
    #ifdef podureman
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    #endif // podureman
    int _ = 1;
    //cin >> _;
    while (_--){
        solve();
    }
}
