#include <bits/stdc++.h>
#pragma optimize("Ofast")
#pragma optimize("O3")

using namespace std;

using ll = long long;

const int INF = 1e9 + 7, mod = 998244353;

#ifdef LOCAL
const int MAXN = 1e2;
#else
const int MAXN = 1e6;
#endif

int t, n, m;

pair<int, int> get(int x1, int type1, int x2, int type2) {
    if ((x1 - x2) % 2 == 0) {
        if (x1 > x2) {
            swap(x1, x2);
            swap(type1, type2);
        }
        if (type1 == 0 && type2 == 1)
            return {abs(x1 - x2) / 2, (x1 + x2) / 2};
        if (type1 == 1 && type2 == 0) {
            int d = max(x1 - 1, m - x2);
            x1 = 1 + (d - (x1 - 1));
            x2 = m - (d - (m - x2));
            return {d + abs(x1 - x2) / 2, (x1 + x2) / 2};
        }
        if(type1 == 0)
            return {m - max(x1, x2) + abs(x1 - x2) / 2, min(x1, x2) + m - max(x1, x2) + abs(x1 - x2) / 2};
        return {min(x1, x2) - 1 + abs(x1 - x2) / 2, max(x1, x2) - (min(x1, x2) - 1 + abs(x1 - x2) / 2)};
    }
    return {-1, -1};
}

pair<int, int> nxt(pair<int, int> a){
    auto [a1, a2] = a;
    int b1 = a1 + m, b2 = m - a2 + 1;
    return {b1, b2};
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> t >> n >> m;
    vector<int> pos(n);
    for (int &i : pos)
        cin >> i;
    string s;
    cin >> s;
    auto [a1, a2] = get(pos[0], s[0] == 'L', pos[1], s[1] == 'L');
    if (a1 != -1) {
        cout << "Yes\n";
        auto [b1, b2] = nxt({a1, a2});
        if(b2 > a2){
            swap(a1, b1);
            swap(a2, b2);
        }
        if (t > 1)
            cout << a2 << '\n';
        if (t > 2)
            cout << "1\n"
                 << a1 << ' ' << a2;
    } else
        cout << "No";
    return 0;
}

//                    {{{{{{
//                    {{{{{
//                ____{____     MEGAKNIGHT!!!
//               /         \  //
//              /  ==   ==  \//
//              |           |
//   __^__     ----------------      __^__
//  /     \    |              |     /     \
// <       >   |              |    <       >
//  \     /_____               _____\     /