#include<bits/stdc++.h>

#define len(v) (int)v.size()
#define all(v) v.begin(), v.end()

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

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];
    }
    string s;
    cin >> s;
    set<pair<int, int>> w;
    vector<int> N(n);
    for (int i = 0; i < n; ++i) {
        int napr;
        if (s[i] == 'R') napr = 1;
        else napr = -1;
        w.insert({a[i], napr});
        N[i] = napr;
    }
    for (int i = 0; i < n; ++i) {
        if (w.find({a[i] + 1, N[i]}) != w.end()) {
            cout << "No\n";
            return;
        }
        if (w.find({a[i] - 1, N[i]}) != w.end()) {
            cout << "No\n";
            return;
        }
        if (a[i] == m - 1 && N[i] == 1) {
            if (w.find({a[i] + 1, -1}) != w.end()) {
                cout << "No\n";
                return;
            }
        }
        if (a[i] == 2 && N[i] == -1) {
            if (w.find({a[i] - 1, 1}) != w.end()) {
                cout << "No\n";
                return;
            }
        }
    }
    cout << "Yes\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
    }
}