#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <experimental/random>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ordered_set = tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>;
using str = string;
using ld = long double;
const ll INF = 1e9, MOD = 998244353;
#define int long long

void solve();

signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    // cin >> _;
    while (_--) {
        solve();
        // cout << "\n";
    }
}

int T;

void solve() {
    cin >> T;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        a[i]--;
    }
    str s;
    cin >> s;
    {
        vector<bool> us(2);
        for (int i = 0; i < n; ++i) {
            if (s[i] == 'L') {
                us[a[i] % 2] = true;
            } else {
                us[(-a[i] % 2 + 2) % 2] = true;
            }
        }
        if (us[0] && us[1]) {
            cout << "No\n";
            return;
        } else {
            cout << "Yes\n";
        }
    }
    if (T == 1) {
        return;
    }
    if (n == 2) {
        cout << (m + 1) / 2 << "\n";
        if (T == 3) {
            cout << 1 << "\n";
            pair<int,int> mx= {-1,-1};
            for (int i = 0; i < 1000000; ++i) {
                for (int j = 0; j < 2; ++j) {
                    if (s[j] == 'L') {
                        a[j]--;
                        if (a[j] == 0) {
                            s[j] = 'R';
                        }
                    } else {
                        a[j]++;
                        if (a[j] == m - 1) {
                            s[j] = 'L';
                        }
                    }
                }
                if (a[0] == a[1]) {
                    mx = max(mx, {a[0], i + 1});
                }
            }
            cout << mx.second + 1 << " " << mx.first + 1;
        }
    }
}
