#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int) x.size()
#define all(x) x.begin(), x.end()
#define int long long

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin >> t;
    int n, m;
    cin >> n >> m;
    int kol0 = 0, kol1 = 0;
    vector<pair<int, int>> a;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        if (x % 2 == 0) {
            kol0++;
        } else {
            kol1++;
        }
        a.pb({x, 0});
    }
    string s;
    cin >> s;
    for (int i = 0; i < n; ++i) {
        a[i].second = s[i] == 'R';
    }
    sort(all(a));
    a.resize(unique(all(a)) - a.begin());
    if (kol0 && kol1) {
        cout << "No";
    } else {
        cout << "Yes\n";
        if (t - 1) {
            n = sz(a);
            if (n == 1) {
                cout << m << "\n";
                if (t == 3) {
                    cout << 0;
                }
            } else if (n == 2) {
                int val1 = 0, time1 = 0;
                if (a[0].second == a[1].second) {
                    if (a[0].first == a[1].first) {
                        if (a[0].second == 0) {
                            val1 = 1;
                            time1 = a[0].first - 1;
                        } else {
                            val1 = m;
                            time1 = m - a[0].first;
                        }
                    } else {
                        if (a[0].second == 0) {
                            val1 = (max(a[0].first, a[1].first) - (min(a[0].first, a[1].first) - 1) + 1) / 2;
                            time1 = (min(a[0].first, a[1].first) - 1) + val1 - 1;
                        } else {
                            val1 = (min(a[0].first, a[1].first) + m - max(a[0].first, a[1].first) + m) / 2;
                            time1 = m - max(a[0].first, a[1].first) + m - val1;
                        }
                    }
                } else {
                    if (a[0].second == 0) {
                        if (a[0].first - 1 > m - a[1].first) {
                            int r = m - ((a[0].first - 1) - (m - a[1].first));
                            val1 = (r + 1) / 2;
                            time1 = a[0].first - 1 + val1 - 1;
                        } else {
                            int l = m - a[1].first - (a[0].first - 1) + 1;
                            val1 = (l + m) / 2;
                            time1 = m - a[1].first + val1 - l;
                        }
                    } else {
                        val1 = (a[0].first + a[1].first) / 2;
                        time1 = val1 - a[0].first;
                    }
                }
                int val2 = m - val1 + 1, time2 = time1 + m - 1;
                if (val1 < val2) {
                    swap(val1, val2);
                    swap(time1, time2);
                }
                if (t == 3) {
                    cout << val1 << "\n" << 1 << "\n" << time1 << " " << val1;
                } else {
                    cout << val1;
                }
            }
        }
    }
    return 0;
}