#include <bits/stdc++.h>
using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx")

#define int long long
#define all(a) a.begin(), a.end()

struct zov {
    int x;
    char t;
    zov(int _x = 0, char _t = 'L') {
        x = _x, t = _t;
    }
};

bool cmp(zov &a, zov &b) {
    return a.x < b.x;
}

void solve() {
    int t, n, m;
    cin >> t >> n >> m;
    vector<int> a(n);
    set<int> st;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        st.insert(a[i]%2);
    }
    string w;
    cin >> w;
    vector<zov> v;
    for (int i = 0; i < n; ++i) {
        v.push_back({a[i], w[i]});
    }
    if (st.size() >= 2) {
        cout << "No";
        return;
    }
    cout << "Yes\n";
    if (t == 1) {
        return;
    }
    if (a[0] == a[1] && w[0] == w[1]) {
        cout << m << endl;
        if (t == 3) {
            cout << 0;
        }
        return;
    }
    sort(all(v), cmp);
    if (v[0].t == 'L' && v[1].t == 'R') {
        int l = v[0].x - 1;
        int r = m - v[1].x;
        // l + x - 1 = r + (m - x)
        int x = r + m + 1 - l;
        x /= 2;
        if (2*x <= m) {
            int tm = l+x-1;
            swap(v[0], v[1]);
            int l = x - 1;
            int r = m - x;
            // l + x - 1 = r + (m - x)
            int x = r + m + 1 - l;
            x /= 2;
            cout << x << endl;
            if (t == 2) {
                return;
            }
            cout << 1 << endl;
            cout << l+x-1+tm << " " << x;
        }else {
            cout << x << endl;
            if (t == 2) {
                return;
            }
            cout << 1 << endl;
            cout << l+x-1 << " " << x;
        }
        return;
    }
    if (v[0].t == 'L' && v[1].t == 'L') {
        int l = v[0].x - 1;
        int r = v[1].x;
        // l + x - 1 = r - x
        int x = r + 1 - l;
        x /= 2;
        if (2*x <= m) {
            int l = x - 1;
            int r = x;
            int tm = l+x-1;
            // l + x - 1 = r - x
            int x = r + 1 - l;
            x /= 2;
            cout << x << endl;
            if (t == 2) {
                return;
            }
            cout << 1 << endl;
            cout << l+x-1+tm << " " << x;
            return;
        }
        cout << x << endl;
        if (t == 2) {
            return;
        }
        cout << 1 << endl;
        cout << l+x-1 << " " << x;
        return;
    }
    if (v[0].t == 'R' && v[1].t == 'L') {
        int l = v[0].x;
        int r = v[1].x;
        int x = (r+l)/2;
        if (2*x <= m) {
            int tm = l+x-1;
            int l = x - 1;
            int r = m - x;
            int x = r + m + 1 - l;
            x /= 2;
            cout << x << endl;
            if (t == 2) {
                return;
            }
            cout << 1 << endl;
            cout << l+x-1+tm << " " << x;
            return;
        }
        cout << (r+l)/2 << endl;
        if (t == 2) {
            return;
        }
        cout << 1 << endl;
        cout << (r-l)/2 << " " << (r+l)/2;
        return;
    }
    if (v[0].t == 'R' && v[1].t == 'R') {
        int l = v[0].x;
        int r = m - v[1].x;
        // x - l = r + m - x
        int x = r + m + l;
        x /= 2;
        int g = x;
        if (1) {
            int tm = x-l;
            int l = x - 1;
            int r = m - x;
            // l + x - 1 = r + (m - x)
            int x = r + m + 1 - l;
            if (x > g) {
                x /= 2;
                return;
                cout << x << endl;
                if (t == 2) {
                    return;
                }
                cout << 1 << endl;
                cout << l+x-1+tm << " " << x;
                return;
            }
        }

        cout << x << endl;
        if (t == 2) {
            return;
        }
        cout << 1 << endl;
        cout << x-l << " " << x;
        return;
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
        cout << '\n';
    }
}