#include <bits/stdc++.h>
//#include <bits/extc++.h>
using namespace std;
//using namespace __gnu_pbds;
using ll = long long;
using ld = long double;
using pii = pair<ll, ll>;
using pic = pair<ll, char>;
using ull = unsigned long long;
//using oset = tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937 rnd('S' + 'E' + 'E' + 'D');
ll l_r(const ll &lb_, const ll &rb_) {return (lb_ + rnd() % (rb_ - lb_ + 1)); }
template<class T> ll szl(const T &v1) { return (ll)v1.size(); }
template<class T> bool mmin(T &v1, const T &v2) { return (v1 > v2 ? v1 = v2, 1 : 0); }
template<class T> bool mmax(T &v1, const T &v2) { return (v1 < v2 ? v1 = v2, 1 : 0); }
#ifndef MiracleFFT
    #pragma GCC optimize("O3,unroll-loops")
    #pragma GCC target("avx,avx2,bmi,bmi2,lzcnt,popcnt")
#endif
const ll INF = 2e9 + 10;
const ll LNF = 2e18 + 10;
const ll MAXN = 2e5 + 10;
const ll MAXX = 1e9 + 10;
const ll MAXC = 1e18 + 10;
const ll ALPH = 26;
const ll BL_SZ = 400;
const ll MAX_LOG = 20;
const ll CNT_OP = 100;
const ll MOD = 1e9 + 7;
const ll P = 179;
const ll M = 1e9 + 787;
const ld UNO = ld(1.0);
const ld PI = atan2(0, -1);
const ld BURN = ld(0.99999);


void solve() {
    ll g;
    cin >> g;
    ll n, m;
    cin >> n >> m;
    vector<ll> a(n);
    for (auto &el : a) {
        cin >> el;
        --el;
    }
    string s;
    cin >> s;

    if (a[0] > a[1]) {
        swap(a[0], a[1]);
        swap(s[0], s[1]);
    }

    vector<ll> c(2);
    for (auto &el : a) {
        c[el % 2]++;
    }
    if (c[0] && c[1]) {
        cout << "No\n";
        return;
    }

    if (a[0] == a[1] && s[0] == s[1]) {
        //throw(0);
        cout << "Yes\n";
        if (g >= 2) {
            cout << m << '\n';
        }
        if (g >= 3) {
            cout << 0 << '\n';
        }
        return;
    }

    //t < m
    auto get = [&](ll x, ll t, char c) {
        if (c == 'L') {
            if (x >= t) {
                x -= t;
            } else {
                t -= x;
                x = 0;
                x += t;
            }
        } else {
            x = m - 1 - x;
            if (x >= t) {
                x -= t;
            } else {
                t -= x;
                x = 0;
                x += t;
            }
            x = m - 1 - x;
        }
        return x;
    };

    ll lb = 0;
    cout << "Yes\n";
    for (ll md = 0; md < m; md++) {
        if (get(a[0], md, s[0]) > get(a[1], md, s[1])) {
            lb = md - 1;
            break;
        }
    }

    ll tim = lb;
    ll cord = get(a[0], tim, s[0]);
    if (g >= 2) {
        cout << max(cord, m - 1 - cord) + 1 << '\n';
    }
    if (g >= 3) {
        cout << "1\n";
        cout << tim << ' ' << max(cord, m - 1 - cord) + 1 << '\n';
    }
}


int main() {
    bool IS_MULTITEST = 0; 
    #ifdef MiracleFFT
        IS_MULTITEST = 1;
        freopen("ain.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << setprecision(9) << fixed;
    //prep();
    ll t = 1;
    if (IS_MULTITEST) {
        cin >> t;
    }
    while (t--) {
        solve();
    }
    #ifdef MiracleFFT
        cout << setprecision(2) << fixed;
        cout << "Time: " << ((ld)clock() / CLOCKS_PER_SEC) << " Sec" << endl;
    #endif
}
