#include<bits/stdc++.h>
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
using ll = long long;
//using oset = tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>;


/*
struct segtree{
    vector<ll> tree;
    ll sz;
    ll def = 0;
    ll merg(ll a, ll b) {
        return a + b;
    }
    void clar(ll n) {
        tree.assign(4 * n, def);
        sz = n;
    }
    segtree() {

    }
    void build(ll v, ll l, ll r, vector<ll> & a) {
        if (r - l == 1) {
            tree[v] = a[l];
            return;
        }
        ll m = (l + r) / 2;
        build(v * 2 + 1, l, m, a);
        build(v * 2 + 2, m, r, a);
        tree[v] = merg(tree[v * 2 + 1], tree[v * 2 + 2]);
    }
    segtree(vector<ll> & a) {
        ll n = (ll)a.size();
        clar(n);
        build(0, 0, sz, a);
    }
};
*/

void solve() {
    ll t;
    cin >> t;
    ll n, m;
    cin >> n >> m;
    vector<ll> cnt(2);
    vector<ll> st;

    for (ll i = 0; i < n; i++) {
        ll a;
        cin >> a;
        st.push_back(a);
        cnt[a % 2]++;
    }

    string s;
    cin >> s;
    if (cnt[0] * cnt[1] != 0) {
        cout << "No" << endl;
        return;
    }
    cout << "Yes" << endl;
    if (t == 1) {
        return;
    }
    ll ans = 0;
    if (s[0] == s[1] && st[0] == st[1]) {
        cout << m << endl;
        if (t == 3) {
            cout << 0 << endl;
            return;
        }
        return;
    }
    vector<pair<ll, ll>> otv;
    for (ll i = 0; i <= m * 2;) {
        if (st[0] == st[1]) {
            if (st[0] > ans) {
                ans = st[0];
                otv = {{i, st[0]}};
            }
        }
        if (s[0] == s[1]) {
            if (s[0] == 'L') {
                ll x = (st[0] + st[1]) / 2 - 1;
                st[0] -= x;
                st[1] -= x;
                if (st[0] <= 1) {
                    st[0] = 2 - st[0];
                    s[0] = 'R';
                }
                if (st[1] <= 1) {
                    st[1] = 2 - st[1];
                    s[1] = 'R';
                }
                i += x;
            } else {
                ll x = (m - st[0] + m - st[1]) / 2;
                st[0] += x;
                st[1] += x;
                if (st[0] >= m) {
                    st[0] = m - (st[0] - m);
                    s[0] = 'L';
                }
                if (st[1] >= m) {
                    st[1] = m - (st[1] - m);
                    s[1] = 'L';
                }
                i += x;
            }
        } else {
            if (st[0] == st[1]) {
                if (s[0] == 'R') {
                    st[0]++;
                    if (st[0] == m) {
                        s[0] = 'L';
                    }
                } else {
                    st[0]--;
                    if (st[0] == 1) {
                        s[0] = 'R';
                    }
                }

                if (s[1] == 'R') {
                    st[1]++;
                    if (st[1] == m) {
                        s[1] = 'L';
                    }
                } else {
                    st[1]--;
                    if (st[1] == 1) {
                        s[1] = 'R';
                    }
                }
                i++;
            } else {
                if (st[0] > st[1]) {
                    swap(st[0], st[1]);
                    swap(s[0], s[1]);
                }
                if (s[0] == 'R' && s[1] == 'L') {
                    i += (st[1] - st[0]) / 2;
                    ll vsp = (st[1] + st[0]) / 2;
                    st[1] = vsp;
                    st[0] = vsp;
                } else {
                    if (s[0] == 'R') {
                        st[0]++;
                        if (st[0] == m) {
                            s[0] = 'L';
                        }
                    } else {
                        st[0]--;
                        if (st[0] == 1) {
                            s[0] = 'R';
                        }
                    }

                    if (s[1] == 'R') {
                        st[1]++;
                        if (st[1] == m) {
                            s[1] = 'L';
                        }
                    } else {
                        st[1]--;
                        if (st[1] == 1) {
                            s[1] = 'R';
                        }
                    }
                    i++;
                }
            }
        }
    }
    cout << ans << endl;
    if (t == 3) {
        cout << 1 << endl;
        cout << otv[0].first << " " << otv[0].second << endl;
    }
}

signed main() {
    int MULTITEST = 0;
    #ifdef zapvm
        MULTITEST = 1;
        freopen("in.txt", "r", stdin);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    if (MULTITEST) {
        cin >> t;
    }
    while (t--) {
        solve();
    }
}