#include "deque"
#include "iostream"
#include "algorithm"
#include "vector"
#include "queue"
using namespace std;
#define int long long
#define all(arr) arr.begin(), arr.end()
#define _lg(x) (63 - __builtin_clzll(x))
constexpr int maxn = 200'010;
constexpr int mod = 1'000'000'007;
int arr[maxn]{};
int n, m;
int when_come(int x, int y, char dir1, char dir2) {
    if (x == y) return 0;
    if (x > y) return when_come(y, x, dir2, dir1);
    if (dir1 == 'R' && dir2 == 'L') {
        return (y - x) / 2;
    }
    if (dir1 == 'R' && dir2 == 'R') {
        return m - y + when_come(x + m - y, m, 'R', 'L');
    }
    if (dir1 == 'L' && dir2 == 'L') {
        return x - 1 + when_come(1, y - (x - 1), 'R', 'L');
    }
    if (dir1 == 'L' && dir2 == 'R') {
        int dist1 = x - 1;
        int dist2 = m - y;
        if (dist1 == dist2) {
            return dist1 + when_come(1, m, 'R', 'L');
        }
        if (dist1 < dist2) {
            return dist1 + when_come(1, y + dist1, 'R', 'R');
        }
        return dist2 + when_come(x - dist2, m, 'L', 'L');
    }
}
void operator+=(pair<int, char>& pr, const int& timet) {
    if (pr.second == 'L') {
        if (timet < pr.first) {
            pr.first -= timet;
        } else {
            pr.first = 1 + timet - (pr.first - 1);
        }
    } else {
        if (pr.first + timet <= m) {
            pr.first = pr.first + timet;
        } else {
            int delta = timet - (m - pr.first);
            pr.first = m - delta;
        }
    }
}
void operator++(pair<int, char>& pr) {
    pr += 1;
}
void solve() {
    int t;
    cin >> t >> n >> m;
    int xxxxx = 0;
    vector<int> have;
    for (int i = 0; i < n; i++) {
        int a; cin >> a;
        have.push_back(a);
        xxxxx |= (1 << (a & 1));
    }
    cout << (xxxxx == 3 ? "No" : "Yes") << '\n';
    if (xxxxx == 3) return;
    if (t == 1) return;
    string s; cin >> s;
    vector<pair<int, char>> vc;
    for (int i = 0; i < n; i++) {
        vc.emplace_back(have[i], s[i]);
    }
    sort(all(vc));
    vc.erase(unique(all(vc)), vc.end());
    deque<int> right;
    deque<int> left;
    int delta;
    while (vc.size() > 1) {
        //auto copy = vc;
        int maxd = 0;
        int timer = -1;
        delta = 0;
        right.clear();
        left.clear();
        for (auto& i : vc) {
            if (i.second == 'R') right.push_back(i.first);
            else left.push_back(i.first);
        }
        for (int i = 1; i <= 2 * m; i++) {
            delta++;
            if (!right.empty() && right.back() + delta == m) {
                right.pop_back();
                left.push_back(m + delta);
            }
            if (!left.empty() && left.front() - delta == 1) {
                left.pop_front();
                right.push_front(1 - delta);
            }
            if (left.empty() || right.empty()) {
                continue;
            }
            int mx = max(left.back() - delta, right.back() + delta);
            int mx_cnt = 1 + ((left.back() - delta) == (right.back() + delta));
            if (mx_cnt >= 2) {
                if (mx > maxd) {
                    maxd = mx;
                    timer = i;
                }
            }
        }
        for (auto& i : vc) {
            i += timer;
        }
        m = maxd;
        sort(all(vc));
        vc.pop_back();
    }
    cout << m << '\n';
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1; //cin >> t;
    while (t--) {
        solve();
    }
}