#include <bits/stdc++.h>

#define int long long
using ll = long long;
using ld = long double;
using namespace std;

const int INF = 1e18, MAXN = 1e5, mod = 998244353;

void solve();

int gg;

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int tt = 1;
    cin >> gg;
    // cin >> tt;
    while (tt--) {
        solve();
        cout << "\n";
    }
}

int mx_m = -INF;
vector<pair<int,int> > ans;

struct node {
    int m, t;
    string s;
    vector<int> arr;
    vector<pair<int,int> > ans1;
};

bool operator<(node a, node b) {
    return a.m < b.m;
}

void solve() {
    int n, m;
    cin >> n >> m;
    m--;
    vector<int> arr(n);
    string s;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        arr[i]--;
    }
    sort(arr.begin(), arr.end());
    cin >> s;


    bool check = true;
    for (int i = 1; i < n; i++) {
        if (arr[i] % 2 != arr[i - 1] % 2) {
            check = false;
        }
    }
    if (!check) {
        cout << "No";
        return;
    }
    cout << "Yes\n";

    int cnt = 0;
    if (s[0] != s[1]) {
        int sm1, sm2;
        if (s[0] == 'L') {
            sm1 = arr[0];
        } else {
            sm1 = m - arr[0];
        }

        if (s[1] == 'L') {
            sm2 = arr[1];
        } else {
            sm2 = m - arr[1];
        }
        if (sm1 == sm2) {
            if (gg >= 2) {
                cout << m / 2 + 1 << "\n";
            }
            if (gg >= 3) {
                cout << 1 << '\n';
                cout << m / 2 << " " << m / 2 + 1 << '\n';
            }
            return;
        }

        int sm = min(sm1, sm2);
        for (int i = 0; i < n; i++) {
            if (s[i] == 'L') {
                arr[i] -= sm;
            } else {
                arr[i] += sm;
            }
        }
        for (int i = 0; i < n; i++) {
            if (arr[i] == 0 && s[i] == 'L') {
                s[i] = 'R';
            }
            if (arr[i] == m && s[i] == 'R') {
                s[i] = 'L';
            }
        }
    }
    if (s[0] == s[1]) {
        assert(0);
    }
}
