#include <bits/stdc++.h>

using namespace std;

#ifndef lisie_bimbi
#define endl '\n'
#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2,bmi2,fma")
#endif

using ll = long long;

void solve(){
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        a[i]--;
    }
    string s;
    cin >> s;
    for(int i = 0; i < n; i++){
        if((s[i] == 'L') && (a[i] != m - 1)){
            a[i] = 2 * m - 2 - a[i];
        }
    }
    sort(a.begin(), a.end());
    // for(auto i : a){
    //     cout << i << ' ';
    // }
    // cout << endl;
    int mx = 0;
    for(int i = 0; i < n; i++){
        if(i != n - 1){
            if(abs(a[i + 1] - a[i]) % 2 != 0){
                cout << "No\n";
                return;
            }else{
                mx = max(mx, a[i + 1] - a[i]);
            }
        }else{
            if(abs(a[0] - a[i]) % 2 != 0){
                cout << "No\n";
                return;
            }else{
                mx = max(mx, a[0] - a[i] + 2 * m - 2);
            }
        }
    }
    cout << "Yes\n";
}

signed main(){
#ifdef lisie_bimbi
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);   
#else
    cin.tie(nullptr)->sync_with_stdio(false);
#endif         
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}