#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pii pair<int, int>
#define ff first
#define ss second
#define ld long double
#define pb push_back
#define ins insert
#define str string
#define int ll

mt19937 rnd(1488);

void solve(){
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    vector<int> cl;
    vector<int> cr;
    vector<int> c(n);
    for (int i = 0; i < n; i++){
        cin >> c[i];
    }
    str s;
    cin >> s;
    for (int i = 0; i < n; i++){
        if (s[i] == 'L'){
            cl.pb(c[i]);
        }
        else{
            cr.pb(c[i]);
        }
    }
    if (cl.size() && cr.size()){
        for (auto i:cl){
            if (i % 2 != cl[0] % 2){
                cout << "No\n";
                return;
            }
        }
        for (auto i:cr){
            if (i % 2 != cl[0] % 2){
                cout << "No\n";
                return;
            }
        }
    }
    cout << "Yes\n";
}

int32_t main(){
    cin.tie(0)->ios_base::sync_with_stdio(0);
    #ifdef podureman
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    #endif // podureman
    int _ = 1;
    //cin >> _;
    while (_--){
        solve();
    }
}
