#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

void fast_in_out() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << setprecision(18) << fixed;
#ifdef LOCAL
    freopen("input.txt", "r",stdin);
    freopen("output.txt", "w",stdout);
#endif
}

typedef tree<int, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define all(x) (x).begin(), (x).end()
#define int long long
using ll = long long;
int p = 0;

void rec(vector<pair<int, int> > vec, int m, int t = 0) {
    if (t >= 20) {
        return;
    }
    int n = (int) vec.size();
    for (int i = 0; i < n; ++i) {
        if (vec[i].first == 0) {
            vec[i].second = 1;
        }
        if (vec[i].first == m - 1) {
            vec[i].second = -1;
        }
    }
    sort(all(vec));
    vec.resize(unique(all(vec)) - vec.begin());
    n = (int) vec.size();

    if (n == 1) {
        p = max(p, m);
        return;
    }
    int t1 = 1;

    for (int i = 0; i < n; ++i) {
        vec[i].first += t1 * vec[i].second;
        if (vec[i].first == 0) {
            vec[i].second = 1;
        }
        if (vec[i].first == m - 1) {
            vec[i].second = -1;
        }
    }

    t += t1;

    sort(all(vec));
    for (int i = m; i > vec[n - 1].first; --i) {
        rec(vec, i, t);
    }
}


int n, m, T;
vector<pair<int, int> > vec;

void solve() {
    cin >> T >> n >> m;
    vec.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> vec[i].first;
        --vec[i].first;
    }
    string s;
    cin >> s;
    for (int i = 0; i < n; ++i) {
        vec[i].second = s[i] == 'L' ? -1 : 1;
    }
    vector<int> ok(2);
    for (int i = 0; i < n; ++i) {
        ok[vec[i].first % 2]++;
    }
    if (ok[0] >= 1 && ok[1] >= 1) {
        cout << "No";
        return;
    } else if (T == 1) {
        cout << "Yes";
        return;
    }
    cout << "Yes\n";
    vector<pair<int, int> > s1;
    rec(vec, m);
    cout << p;
}

signed main() {
    fast_in_out();
    int qwe = 1;
    // cin >> qwe;
    while (qwe--) {
        solve();
    }
}
