#include <bits/stdc++.h>
using namespace std;

#pragma GCC optimize("O3", "Ofast", "unroll-loops", "fast-math")
#pragma GCC target("avx", "avx2")

using ll = long long;
using lll = __int128;
using dd = long double;
using para = pair <ll, ll>;
using parad = pair <dd, dd>;
using vll = vector <ll>;
struct f {
    ll i = -1, j = -1, nap = -1;
};
void solvetask() {
    ll T;
    cin >> T;
    ll n, m;
    cin >> n >> m;
    set <ll> ost;
    vector <f> a(n);
    for (ll i = 0; i < n; ++i) {
        cin >> a[i].j;
        a[i].j--;
        a[i].i = i;
        ost.insert(a[i].j % 2);
    }
    string s;
    cin >> s;
    for (ll i = 0; i < n; ++i) {
        if (s[i] == 'L') {
            a[i].nap = 0;
        } else {
            a[i].nap = 1;
        }
    }
    if (ost.size() == 1) {
        cout << "Yes";
    } else {
        cout << "No";
        return;
    }
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll tests = 1;
    //cin >> tests;
    while (tests--) {
        solvetask();
    }
    return 0;
}