#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define sz(x) (int)(x.size())

constexpr int N = 1e7;
constexpr int inf = 1e18;
constexpr int mod = 998244353;

int n, m;

int solve(int a0, int a1, char s0, char s1) {
    if (a0 == a1 && s0 == s1) {
        return m;
    }
    if (a0 > a1) {
        swap(a0, a1);
        swap(s0, s1);
    }
    int cnt = 0;
    if (s0 == 'R' && s1 == 'L') {
    } else {
        if (s0 == 'L') {
            cnt = a0 - 1;
        }
        if (s1 == 'R') {
            cnt = max(cnt, m - a1);
        }
        if (s0 == 'L') {
            a0 = cnt - a0 + 2;
        } else {
            a0 += cnt;
        }
        if (s1 == 'R') {
            a1 = m - (cnt - (m - a1));
        } else {
            a1 -= cnt;
        }
        s0 = 'R';
        s1 = 'L';
    }
    // cout << a[0] << ' ' << a[1] << endl;
    if ((a1 - a0) % 2 == 1) {
        return -inf;
    } else {
        int cnt2 = 0;
        if ((a0 + a1) / 2 < (m + 1) / 2) {
            swap(a0, a1);
            swap(s0, s1);
            if (s0 == 'L') {
                cnt2 = a0 - 1;
            }
            if (s1 == 'R') {
                cnt2 = max(cnt2, m - a1);
            }
            if (s0 == 'L') {
                a0 = cnt2 - a0 + 2;
            } else {
                a0 += cnt2;
            }
            if (s1 == 'R') {
                a1 = m - (cnt2 - (m - a1));
            } else {
                a1 -= cnt2;
            }
        }
        return (a0 + a1) / 2;
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    string s;
    cin >> s;
    int ans = m;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ans = min(ans, solve(a[i], a[j], s[i], s[j]));
            //cout << i << ' ' << j << ' ' << solve(a[i], a[j], s[i], s[j]) << endl;
        }
    }
    if (ans == -inf) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
        if (t != 1) {
            cout << ans << endl;
        }
    }
    return 0;
}
