#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;
const int N = 2e5;
int n, m, T;
pair<int, int> vec[N];

void solve() {
    cin >> T >> n >> m;
    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;
    }
    if (T == 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";
        } else {
            cout << "Yes";
        }
        return;
    }
    if (vec[0] == vec[1]) {
        cout << "Yes\n";
        if (T == 1) {
            return;
        }
        cout << m << '\n';
        if (T == 2) {
            return;
        }
        cout << 0 << '\n';
    }
    if (vec[0].first % 2 == vec[1].first % 2) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
        return;
    }
    if (T == 1) {
        return;
    }
    int x = (vec[0].first + vec[1].first) / 2 + 1;
    x = max(x, m - x + 1);
    cout << x << '\n';
    if (T == 2) {
        return;
    }
    cout << "1\n";
    --x;
    vector<int> ans;
    for (int i = 0; i < 2; ++i) {
        if (vec[i].first <= x && vec[i].second == 1) {
            ans.emplace_back(x - vec[i].first);
        }
        if (vec[i].first <= x && vec[i].second == -1) {
            ans.emplace_back(vec[i].first + x);
        }
        if (vec[i].first > x && vec[i].second == -1) {
            ans.emplace_back(vec[i].first - x);
        }
        if (vec[i].first > x && vec[i].second == 1) {
            ans.emplace_back(m - 1 + m - 1 - x - vec[i].first);
        }
    }
    cout << max(ans[0], ans[1]);
    cout << ' ' << ++x;
}

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