#include <bits/stdc++.h>

using namespace std;

void solve();

// #include<ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
#pragma GCC optimize("O3,Ofast,unroll-loops")

int main() {
#ifdef LOCAL
    freopen("input.txt", "r",stdin);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    //cin>>t;
    while (t--) {
        solve();
    }
    return 0;
}

#define int long long
#define endl '\n'
const int N = 1e5+100, MOD = 998244353, INF = 2e18;
const double EPS = 1e-6, pi = acos(-1);
int add(int a,int b) {
    if (a+b>=MOD)return a+b-MOD;
    return a+b;
}
int sub(int a,int b) {
    if (a-b<0)return a-b+MOD;
    return a-b;
}
int mul(int a,int b) {
    return (a*b)%MOD;
}
int n,m;

int dist(int pos,int next,char s) {
    if (pos==next)return 0;
    if (s=='L') {
        if (next>pos) {
            return next+pos-2;
        }else {
            return pos-next;
        }
    }else {
        if (next>pos) {
            return next-pos;
        }else {
            return (m-pos)+(m-next);
        }
    }
}
void solve() {
    int t;
    cin>>t;
    cin>>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 s;
    cin>>s;
    if (st.size()==2) {
        cout<<"No"<<endl;
        return;
    }
    cout<<"Yes"<<endl;
    if (t==1)return;
    int mx=0,mxt=0;
    for (int i=1;i<=m;i++) {
        int df=dist(a[0],i,s[0]);
        int ds=dist(a[1],i,s[1]);
        if (df==ds) {
            mx=i;
            mxt=df;
        }
    }
    if (mx==0)assert(0);
    cout<<mx<<endl;
    if (t==2)return;
    cout<<1<<endl;
    cout<<mxt<<" "<<mx<<endl;
}
