#include <bits/stdc++.h>

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

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

void solve()
{
    int t, n, m;
    cin >> t >> n >> m;
    vector<int> a(n);
    string s;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    cin >> s;
    int cnt0 = 0, cnt1 = 0
    for (int i = 0; i < n; ++i)
    {
        int pos = a[i];
        if (s[i] == 'L')
        {
            pos = (m - 1 - a[i]) + m - 1;
        }
        if (pos % 2 == 0)
        {
            ++cnt0;
        } else
        {
            ++cnt1;
        }
    }
    if (cnt0 == 0 || cnt1 == 0)
    {
        cout << "Yes";
    } else
    {
        cout << "No";
    }

    /*if (m % 2 == 0)
    {
        cout << "No";
        return;
    }
    cout << "Yes\n";
    if (t == 1) return;
    cout << (m + 1) / 2 << "\n";
    if (t == 2) return;
    cout << "1\n";
    cout << m / 2 << ' ' << (m + 1) / 2;*/
}

int main()
{
    cin.tie(0)->sync_with_stdio(0);
    int t = 1;
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);

    //cin >> t;

    while (t--)
    {
        solve();
        cout << '\n';
    }
    return 0;
}
