#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;

    int mx = -1;
    vector<pair<int, int> > tm;

    for (int i = 0; i < 2 * m; i++) {
        if (a[0] == a[1]) {
            if (a[0] > mx) {
                mx = a[0];
                tm = {{i, mx}};
            }
        } else {
            if (a[0] < a[1]) {
                swap(a[0], a[1]);
                swap(s[0], s[1]);
            }
            if (s[0] == 'R' && s[1] == 'L') {
                int pos = (a[0] + a[1]) / 2;
                if (pos > mx) {
                    mx = pos;
                    tm = {{i, a[0]}, {i + a[0] + a[1] + (a[0] - a[1]) / 2, pos}};
                }
            }
        }

        if (s[0] == 'L') {
            a[0]--;
        } else {
            a[0]++;
        }
        if (a[0] == 0) {
            s[0] = 'R';
        }
        if (a[0] == m - 1) {
            s[0] = 'L';
        }
        if (s[1] == 'L') {
            a[1]--;
        } else {
            a[1]++;
        }
        if (a[1] == 0) {
            s[1] = 'R';
        }
        if (a[1] == m - 1) {
            s[1] = 'L';
        }
    }

    if (t < 2) {
        return;
    }

    cout << mx + 1 << endl;

    if (t < 3) {
        return;
    }

    cout << tm.size() << endl;

    for (auto it: tm) {
        cout << it.ff << " " << it.ss + 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();
    }
}
