#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    int T;
    cin >> T;
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for(int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    string s;
    cin >> s;
    vector<pair<int,int>> penis(m);
    for(int i = 0; i < n; ++i) {
        if(s[i] == 'L') {
            penis[a[i]-1].first = 1;
        } else {
            penis[a[i]-1].second = 1;
        }
    }
    bool ok1 = true;
    bool ok2 = true;
    bool ok3 = false;
    for(int i = 0; i < m; ++i) {
        ok1 &= penis[i].first;
        ok2 &= penis[i].second;
    }
    for(int i = 1; i < m; ++i) {
        ok3 |= (penis[i-1].first & penis[i].second);
        // ok3 |= (penis[i].first & penis[i-1].second);
    }
    sort(a.begin(),a.end());
    a.erase(unique(a.begin(),a.end()), a.end());    
    if((a.size() == m && (ok1 || ok2)) || ok3) {
        cout << "No\n";
    } else {
        cout << "Yes\n";
    }
    return 0;
}