#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")

#define int long long
#define ff first
#define ss second
#define endl "\n"
#define all(x) x.begin(), x.end()
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update<>>

const int MOD = 998244353;
const int INF = 1e18;


void solve() {
    int t, n, m;
    cin >> t >> n >> m;

    vector<int> a(n, 0);

    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]--;
    }

    string s;
    cin >> s;

    vector<int> cnt(2, 0);

    for (int i = 0; i < n; i++) {
        int curr = a[i];
        if (s[i] == 'L') {
            curr = 2 * m - a[i];
        }
        cnt[curr % 2]++;
    }

    if (cnt[0] && cnt[1]) {
        cout << "No" << endl;
        return;
    }

    cout << "Yes" << endl;

    if (a[0] == a[1] && s[0] == s[1]) {
        cout << m << endl;
        if (t == 3) {
            cout << 0 << endl;
        }
        return;
    }

    int mx = -1;
    int tm = -1;


    if (s[0] == 'L' && s[1] == 'L') {
        mx = m - 1 - abs(a[0] - a[1]) / 2;
        tm = m - 1 - max(a[0], a[1]) + abs(a[0] - a[1]) / 2;
        tm += m - 1;
    } else if (s[0] == 'R' && s[1] == 'R') {
        mx = m - 1 - abs(a[0] - a[1]) / 2;
        tm = m - 1 - max(a[0], a[1]) + abs(a[0] - a[1]) / 2;
    } else {
        if (a[0] < a[1]) {
            swap(s[0], s[1]);
            swap(a[0], a[1]);
        }
        if (s[1] == 'R') {
            mx = (a[0] + a[1]) / 2;
            tm = abs(a[1] - a[0]) / 2;
        } else {
            mx = (a[0] + a[1]) / 2;
            tm = abs(a[1] - a[0]) / 2;
            tm += m - 1;
        }
        if (mx < m - 1 - mx) {
            mx = m - 1 - mx;
            tm += m - 1;
        }
    }

    cout << mx + 1 << endl;

    if (t < 3) {
        return;
    }

    cout << 1 << endl;

    cout << tm << " " << mx + 1 << endl;
}


signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    // cin >> t;

    while (t--) {
        solve();
    }
}
