#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <random>
#include <deque>
#include <queue>
#include <unordered_set>
#include <unordered_map>

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

using namespace std;

mt19937 rnd(52);

typedef long long ll;
typedef long double ld;

const ll MAXN = 2e5 + 1;
const ll MOD = 998244353;
const ll INF = 1e18;

vector<int> pos(MAXN);
vector<char> dir(MAXN);
int n, m;

vector<pair<int, int>> cross(int a, int b){
    if(pos[a] > pos[b]) swap(a, b);
    int posa = pos[a], posb = pos[b];
    vector<pair<int, int>> ans;
    if(dir[a] == 'R' && dir[b] == 'L'){
        ans.emplace_back((posb - posa) / 2, (posa + posb) / 2);
        ans.emplace_back((posb - posa) / 2 + m - 1, m - (posa + posb) / 2 + 1);
    }
    if(dir[a] == 'R' && dir[b] == 'R'){
        int val = m - posb;
        posa += m - posb;
        posb = m;
        ans.emplace_back((posb - posa) / 2 + val, (posa + posb) / 2);
        ans.emplace_back((posb - posa) / 2 + val + m - 1, m - (posa + posb) / 2 + 1);
    }
    if(dir[a] == 'L' && dir[b] == 'L'){
        int val = posa - 1;
        posb -= (posa - 1);
        posa = 1;
        ans.emplace_back((posb - posa) / 2 + val, (posa + posb) / 2);
        ans.emplace_back((posb - posa) / 2 + val + m - 1, m - (posa + posb) / 2 + 1);
    }
    if(dir[a] == 'L' && dir[b] == 'R'){
        abort();
        int val = min(posa - 1, m - posb);
        posa -= val;
        posb += val;
        ans.emplace_back((posb - posa) / 2 + val, (posa + posb) / 2);
        ans.emplace_back((posb - posa) / 2 + val + m - 1, m - (posa + posb) / 2 + 1);
    }
    return ans;
}

bool comp(pair<int ,int> a, pair<int ,int> b){
    return a.second > b.second || (a.second == b.second && a.first < b.first);
}


void solve(){
    int type;
    cin >> type;
    cin >> n >> m;
    for(int i = 1; i <= n; i++){
        cin >> pos[i];
    }
    for(int i = 1; i <= n; i++){
        cin >> dir[i];
    }
    int check = pos[1] % 2;
    for(int i = 1; i <= n; i++){
        if(pos[i] % 2 != check){
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
    if(type == 1) return;
    vector<pair<int, int>> ans = cross(1, 2);
    sort(all(ans), comp);
    cout << ans[0].second << endl;
    if(type == 2) return;
    cout << 1 << endl;
    cout << ans[0].first << " " << ans[0].second << endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}