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

#pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2")

#define int long long

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define rep(i,j,k) for (int (i) = (j); (i) < (k); ++i)
#define rrep(i,j,k) for (int (i) = (j); (i) >= (k); --i)
#define re return
#define pb push_back

using namespace std;
using namespace __gnu_pbds;

using ordered_set = tree<int, less<>, null_type, rb_tree_tag, tree_order_statistics_node_update>;
using ordered_multiset = tree<int, less_equal<>, null_type, rb_tree_tag, tree_order_statistics_node_update>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using si = set<int>;
using msi = multiset<int>;

void amin(int& a, int b) {
    a = min(a, b);
}

void amax(int& a, int b) {
    a = max(a, b);
}

void solve();

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int tt = 1;
    // cin >> tt;
    while (tt--) {
        solve();
    }
}

/* ------------------------------------- ACTUAL CODE STARTS HERE ------------------------------------- */

random_device rd;
mt19937 rnd(rd());

const int INF = 2e18;

int type, n, m;

int get_pos(int x, int tm, char c) {
    if (c == 'L') {
        if (x - 1 >= tm) {
            x -= tm;
            re x;
        }
        tm -= x - 1;
        tm %= 2 * (m - 1);
        x = 1;
        if (tm <= m - 1) {
            x += tm;
            re x;
        }
        x = n;
        tm -= m - 1;
        re x - tm;
    } else {
        if (m - x >= tm) {
            x += tm;
            re x;
        }
        tm -= m - x;
        tm %= 2 * (m - 1);
        x = m;
        if (tm <= m - 1) {
            re x - tm;
        }
        tm -= m - 1;
        x = 1;
        re x + tm;
    }
}

void solve() {
    cin >> type >> n >> m;
    vi a(n); for (int& x : a) cin >> x;
    string s; cin >> s;
    int chet = a[0] % 2;
    rep(i, 0, n) {
        if (a[i] % 2 != chet) {
            cout << "No\n"; re;
        }
    }
    if (a[0] == a[1] && s[0] == s[1]) {
        cout << "Yes\n";
        if (type >= 2) {
            cout << m << "\n";
        }
        if (type >= 3) {
            cout << 0 << "\n";
        }
        re;
    }
    int cur_time = 0, best = -1, timee = -1;
    rep(i, 0, 1e6) {
        if (s[0] == 'L') {
            a[0]--;
        } else {
            a[0]++;
        }
        if (s[1] == 'L') {
            a[1]--;
        } else {
            a[1]++;
        }
        if (a[0] == 1) {
            s[0] = 'R';
        } else if (a[0] == m) {
            s[0] = 'L';
        }
        if (a[1] == 1) {
            s[1] = 'R';
        } else if (a[1] == m) {
            s[1] = 'L';
        }
        cur_time++;
        if (a[0] == a[1] && best < a[0]) {
            best = a[0];
            timee = cur_time;
        }
    }
    if (best == -1) {
        cout << "No\n"; re;
    } else {
        cout << "Yes\n";
        if (type >= 2) {
            cout << best << "\n";
        }
        if (type >= 3) {
            cout << 1 << "\n";
            cout << timee << " " << best << "\n";
        }
        re;
    }
    /*cin >> type >> n >> m;
    vi a(n); for (int& x : a) cin >> x;
    string s; cin >> s;
    int chet = a[0] % 2;
    rep(i, 0, n) {
        if (a[i] % 2 != chet) {
            cout << "No\n"; re;
        }
    }
    int cur_time = 0;
    if (s == "LL") {
        sort(all(a));
        if (a[0] == a[1]) {
            cout << "Yes\n";
            if (type >= 2) cout << m << "\n";
            if (type >= 3) cout << 0 << "\n";
            re;
        }
        cur_time += a[0] - 1;
        int y = a[1] - (a[0] - 1);
        int x = 1;
        a[0] = x;
        a[1] = y;
    } else if (s == "RR") {
        sort(all(a));
        if (a[0] == a[1]) {
            cout << "Yes\n";
            if (type >= 2) cout << m << "\n";
            if (type >= 3) cout << 0 << "\n";
            re;
        }
        cur_time += m - a[1];
        int x = a[0] + m - a[1];
        int y = m;
        a[0] = x;
        a[1] = y;
    } else if (s == "LR" && a[0] < a[1]) {
        int tm = max(a[0] - 1, m - a[1]);
        cur_time += tm;
        int x = get_pos(a[0], tm, 'L');
        int y = get_pos(a[1], tm, 'R');
        a[0] = x;
        a[1] = y;
    } else if (s == "RL" && a[0] > a[1]) {
        int tm = max(a[1] - 1, m - a[0]);
        cur_time += tm;
        int x = get_pos(a[1], tm, 'L');
        int y = get_pos(a[0], tm, 'R');
        a[0] = x;
        a[1] = y;
    }
    sort(all(a));
    cout << "Yes\n";
    if (type >= 2) {
        cout << (a[0] + a.back()) / 2 << "\n";
    }
    if (type == 3) {
        cout << 1 << "\n";
        cout << (a.back() - a[0]) / 2 + cur_time << " " << (a[0] + a.back()) / 2 << "\n";
    }
    /*if (type >= 2) {
        cout << (a[0] + a.back()) / 2 << "\n";
    }
    if (type == 3) {
        cout << 1 << "\n";
        cout << (a[0] + a.back()) / 2 - 1 << " " << (a[0] + a.back()) / 2 << "\n";
    }*/
}