#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #pragma GCC target("avx2,bmi")

using namespace std;
// using namespace __gnu_pbds;
// template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

void solve();

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    int t = 1;
    while (t--) {
        solve();
    }
}

#define int long long
const int MAXN = 1e6 + 1, MOD = 998244353, INF = 2e18;


void solve() {
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (i > 0) {
            if (a[i] % 2 != a[i - 1] % 2) {
                cout << "No";
                return;
            }
        }
    }

    string s;
    cin >> s;
    if (1 == t) {
        cout << "Yes\n";
        return;
    }
    vector<int> dist(n);
    for (int i = 0; i < n; i++) {
        if (s[i] == 'R') {
            dist[i] = m - a[i];
        } else {
            dist[i] = m + a[i] - 2;
        }
    }
    bool f = 1;
    for (int i = 1; i < n; i++) {
        if (dist[i] != dist[i - 1])f = 0;
    }
    if (f) {
        cout << "Yes\n";
        if (t >= 2) {
            cout << m << '\n';
        }
        if (t == 3) {
            cout << 0;
        }
        return;
    }
    if (n == 3) {
        if (a[0] == a[1]) {
            a[1] = a[2];
        } else if (a[1] == a[2]) {
            a[0] = a[2];
        }
    }
    int ans = -1;
    int rez = -1;
    int t1 = -1;
    int all = 0;
    for (int _ = 0; _ < 20; _++) {
        if (a[0] < a[1] && s[0] == 'R' && s[1] == 'L') {
            int e = (a[1] - a[0]) / 2;
            if (e + a[0] > ans) {
                ans = e + a[0];
                rez = e + a[0];
                t1 = all + e;
            }
        } else if (a[1] < a[0] && s[1] == 'R' && s[0] == 'L') {
            int e = (a[0] - a[1]) / 2;
            if (e + a[1] > ans) {
                ans = e + a[1];
                rez = e + a[1];
                t1 = all + e;
            }
        }
        int tt = INF;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'L') {
                tt = min(a[i] - 1, tt);
            } else {
                tt = min(m - a[i], tt);
            }
        }
        for (int i = 0; i < n; i++) {
            if (s[i] == 'L') {
                a[i] -= tt;
            } else {
                a[i] += tt;
            }
            if (a[i] == m) {
                s[i] = 'L';
            } else if (a[i] == 1) {
                s[i] = 'R';
            }
        }
        all += tt;
    }
    cout << "Yes\n";
    if (t >= 2) {
        cout << ans << '\n';
    }
    if (t == 3) {
        cout << 1 << '\n';
        cout << t1 << ' ' << rez;
    }
}
