#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif

using namespace std;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ff first
#define ss second
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = long double;

constexpr int MOD = (int)1e9 + 7;

struct mint {
    int x;
    mint() : x(0) {}
    mint(int y) {
        if (y >= MOD) y -= MOD;
        if (y < 0) y += MOD;
        x = y;
    }
    mint(ll y) {
        if (y >= MOD) y %= MOD;
        if (y < 0) y += MOD;
        x = y;
    }
    mint operator+(const mint& b) const {
        return x + b.x;
    }
    mint operator-(const mint& b) const {
        return x - b.x;
    }
    mint operator*(const mint& b) const {
        return x * (ll) b.x;
    }
    mint& operator+=(const mint& b) {
        return *this = *this + b;
    }
    mint& operator-=(const mint& b) {
        return *this = *this - b;
    }
    mint& operator*=(const mint& b) {
        return *this = *this * b;
    }
};

struct point {
    ll x, y;

    point operator+(const point& b) const {
        return {x + b.x, y + b.y};
    }
    point operator-(const point& b) const {
        return {x - b.x, y - b.y};
    }
    ll operator*(const point& b) const {
        return x * b.x + y * b.y;
    }
    ll operator%(const point& b) const {
        return x * b.y - y * b.x;
    }
    ll len_sqr() const {
        return x * x + y * y;
    }
    ld len() const {
        return sqrtl(len_sqr());
    }
};

signed main() {
#ifdef LOCAL
    freopen("in", "r", stdin);
    freopen("out", "w", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    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;
    vector<int> b(n);
    for (int i = 0; i < n; i++) {
        b[i] = (s[i] == 'R' ? a[i] - 1 : 2 * m - a[i] - 1);
    }
    bool odd = false, even = false;
    for (int x : b) {
        if (x & 1) odd = true;
        else even = true;
    }
    if (odd && even) {
        cout << "No\n";
        return 0;
    } else {
        cout << "Yes\n";
    }
    if (t == 1) return 0;
    int x = *max_element(all(b)) - *min_element(all(b));
    x = min(x, 2 * m - *min_element(all(b)) - *max_element(all(b)));
    cout << m - x / 2 << '\n';
    if (t == 2) return 0;
    
}