#include <bits/stdc++.h>

#ifndef LOCAL
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
#endif

using namespace std;
using ll = int64_t;
const ll inf = 1e18;
void solve();

template<typename T, typename T1> T remax(T& x, T1 y) { if (x < y) x = y; return x; }
template<typename T, typename T1> T remin(T& x, T1 y) { if (y < x) x = y; return x; }

int main() {
#ifdef BLOCKS
    freopen("input.txt", "r", stdin);
#endif // BLOCKS
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
//    cin >> t;
    while (t--) solve();
}
#define int int64_t

void solve() {
    int t; cin >> t;
    int n, m; cin >> n >> m;
    vector<int> a(n);
    for (auto& x : a) cin >> x;
    string s; cin >> s;
    bool ok = 1;
    for (int i = 1; i < n; ++i) ok &= ~(a[i] - a[0]) & 1;
//    cout << (ok ? "Yes\n" : "No\n");
    if (!ok) {
        cout << "No\n";
        return;
    }
    cout << "Yes\n";
    if (t == 1) return;
    int time = 0;
    while (true) {
        if (a[0] == a[1]) {
            if (s[0] == s[1]) {
                cout << m << '\n';
                if (t == 2) return;
                cout << 0;
                return;
            }
            cout << a[1] << '\n';
            if (t == 2) return;
            cout << time << ' ' << a[1] << '\n';
            return;
        }
        if (s[0] == 'R') a[0]++;
        else a[0]--;
        if (s[1] == 'L') a[1]--;
        else a[1]++;
        if (a[0] == m) s[0] = 'L';
        if (a[0] == 1) s[0] = 'R';
        if (a[1] == m) s[1] = 'L';
        if (a[1] == 1) s[1] = 'R';
        time++;
    }
}
