//#pragma GCC optimize("Ofast,unroll-loops,fast-math")
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define cin(v) for (auto& el : v) {cin >> el;}
#define cout(v) for(auto& el : v) {cout << el << " ";} cout << "\n";

using namespace std;
using ll = long long;
using db = double;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;

void solve() {
    int T;
    cin >> T;
    int n, m;
    cin >> n >> m;
    vector<int> vec(n);
    cin(vec);
    string st;
    cin >> st;
    vector<int> have(2);
    for (int i = 0; i < vec.size(); i++) {
        have[vec[i] % 2] = 1;
    }
    if (have[0] && have[1]) {
        cout << "No";
        return;
    } else {
        cout << "Yes\n";
    }
    if (T == 1) {
        return;
    }
    int cur1 = vec[0], cur2 = vec[1];
    char type1 = st[0], type2 = st[1];
    /*group 3
    cout << m / 2 + 1 << "\n";
    if (T == 3) {
        cout << 1 << "\n";
        cout << m / 2 << " " << m / 2 + 1;
    }
    return;*/
    if (cur1 == cur2 && type1 == type2) {
        cout << m << "\n";
        if (T == 3) {
            cout << 0;
        }
        return;
    }
    for (int i = 0; i <= 2 * m; i++) {
        if (cur1 == cur2) {
            cout << cur1 << "\n";
            if (T == 2) {
                return;
            }
            cout << 1 << "\n";
            cout << i << " " << cur1;
            return;
        }
        if (type1 == 'R') {
            if (cur1 == m) {
                cur1 = m - 1;
                type1 = 'L';
            } else {
                cur1++;
            }
        } else {
            if (cur1 == 1) {
                cur1 = 2 ;
                type1 = 'R';
            } else {
                cur1--;
            }
        }
        if (type2 == 'R') {
            if (cur2 == m) {
                cur2 = m - 1;
                type2 = 'L';
            } else {
                cur2++;
            }
        } else {
            if (cur2 == 1) {
                cur2 = 2 ;
                type2 = 'R';
            } else {
                cur2--;
            }
        }
    }
    return;
}

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int multitest = 0;
    if (multitest) {
        int t;
        cin >> t;
        while (t--) {
            solve();
        }
    } else {
        solve();
    }
}