// #pragma GCC optimize("O3,fast-math,unroll-loops")
#include <bits/stdc++.h>

#define i64 int64_t
#define vi vector<int>
#define vvi vector<vi>
#define vc vector
#define vb vc<bool>
#define pb push_back
#define pii pair<int, int>
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

using namespace std;

template <typename T>

istream& operator>>(istream& in, vector<T> &a) {
    for (T &el : a) in >> el;
    return in;
}

template <typename T>

ostream& operator<<(ostream& out, vector<T> a) {
    for (T &el : a) out << el << " ";
    return out;
}


void solve() {
    int T;
    cin >> T;
    int n, m;
    cin >> n >> m;
    vi a(n);
    cin >> a;
    string s;
    cin >> s;
    vi cnt(2);
    for (int i = 0; i < n; ++i) ++cnt[(i + a[i]) % 2];
    string ans1 = (a[0] % 2 == a[1] % 2 ? "Yes" : "No");
    vc<pii> ans;
    int cnt1 = 2 * m;
    int i = 0;
    if (ans1 == "No") {
        cout << ans1;
        return;
    }
    if (a[0] == a[1] && s[0] == s[1]) {
        cout << "Yes\n";
        if (T == 2) {
            cout << m;
            return;
        }
        if (T == 3) {
            cout << m << '\n';
            cout << 0 << '\n';
        }
        return;
    }
    while (ans.size() < 2 || (ans.size() == 1 && ans[0].se == (m + 1) / 2 && m % 2== 1)) {
        if (a[0] == 1 && s[0] == 'L') s[0] = 'R';
        if (a[1] == 1 && s[1] == 'L') s[1] = 'R';
        if (a[0] == m && s[0] == 'R') s[0] = 'L';
        if (a[1] == m && s[1] == 'R') s[1] = 'L';
        if (a[0] == a[1] && a[0] != m) {
            ans.pb({i, a[0]});
        }
        if (a[0] > a[1]) {
            swap(a[0], a[1]);
            swap(s[0], s[1]);
        }
        int cnt_l = 0;
        int cnt_r = 0;
        if (s[0] == 'L') cnt_l = a[0] - 1;
        else cnt_l = m - a[0];
        if (s[1] == 'R') cnt_r = m - a[1];
        else cnt_r = a[1] - 1;
        int cnt = m + 179;
        if (a[0] != a[1] && s[0] == 'R' && s[1] == 'L') {
            cnt = (a[1] - a[0]) / 2;
        }
        int s1 = min({cnt, cnt_l, cnt_r});
        a[0] += (s[0] == 'L' ? -s1 : s1);
        a[1] += (s[1] == 'L' ? -s1 : s1);
        i += s1;
    }
    if (!ans.size()) {
        cout << "No";
        return;
    }
    cout << "Yes\n";
    if (T == 1) return;
    sort(all(ans), [&](pii a, pii b) {
        if (a.se == b.se) return a.fi < b.fi;
        return a.se > b.se;
    });
    assert(ans.size());
    if (T == 2) {
        cout << ans[0].se;
        return;
    }
    cout << ans[0].se << '\n';
    cout << 1 << '\n';
    cout << ans[0].fi << " " << ans[0].se;
}

int32_t main() {
    // freopen("inputa.txt", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
}