#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target ("avx2,bmi")
using namespace std;
// using namespace __gnu_pbds;
#define int long long
// typedef tree<int,null_type,less<>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
const int N = 1e6 + 10, mod = 998244353, inf = 1e18;

void solve() {
    int n, m, k, x;
    int t;
    cin >> t;
    cin >> n >> m;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; i++)cin >> a[i];
    for (int i = 0; i < n; i++) {
        char c;
        cin >> c;
        if (c == 'L')b[i] = -1;
        else b[i] = 1;
    }
    if (a[0] > a[1]) {
        swap(a[0], a[1]);
        swap(b[0], b[1]);
    }
    int ans = 0;
    if (b[0] == 1 && b[1] == -1) {
        ans += abs(a[0] - a[1]) / 2;
        swap(b[0], b[1]);
        a[0] += ans;
        a[1] -= ans;
    }
    if (b[0] == -1 && b[1] == 1) {
        if (a[0] - 1 < m - a[1]) {
            ans += a[0] - 1;
            a[1] += a[0] - 1;
            a[0] = 1;
            b[0] = 1;
        } else {
            ans += m - a[1];
            a[0] -= m - a[1];
            a[1] = m;
            b[1] = -1;
        }
    }
    if ((a[1] - a[0]) % 2 == 1) {
        cout << "No";
        return;
    }
    cout << "Yes\n";
    if (t >= 2) {
        cout << m - abs((a[0] - a[1]) / 2) << "\n";
    }
    if (t == 3) {
        cout << "1 ";
        if (b[0] == -1) {
            ans += m - 1 + a[0] - 1 + abs(a[0] - a[1]) / 2;
        } else {
            ans += m - a[1] + abs(a[0] - a[1]) / 2;
        }
        cout << ans << " " << m - abs((a[0] - a[1]) / 2);
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
}
