#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define pw(x) ((1LL)<<(x))
#define sz(x) (ll)x.size()
#define all(x) x.begin(), x.end()

using ll = long long;
using ld = long double;

using namespace std;

const ll N = 5e5 + 52;
const ll INF = 1e18;
const ll MOD = 998244353;

ll n, m;
ll i, j;
string s;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    #ifdef LOCAL
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif // LOCAL
    ll t;
    cin >> t;
    cin >> n >> m;
    vector<ll> a(n);
    set<ll> b;
    set<ll> c;
    for (i=0;i<n;i++){
        cin >> a[i];
        b.insert(a[i]%2);
    }
    cin >> s;
    if (sz(b)>1){
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    if (t==1) return 0;
    ll r = m;
    while(true){

        ll MX = 100;
        ll mxx=0;
        while(MX--){
        ll mx=0;
        map<ll,set<char>> p;
        map<ll,ll> kol;
        for (i=0;i<n;i++){
            if (a[i]==1) s[i]='R';
            if (a[i]==r) s[i]='L';
            if (s[i]=='R') a[i]++;
            else a[i]--;
            mx=max(mx,a[i]);
            p[a[i]].insert(s[i]);
            kol[a[i]]++;
        }
            if (sz(p[mx])>1){
                mxx=max(mxx,mx);
            }
        }
        MX = 100;
        while(MX--){
            ll mx=0;
        map<ll,set<char>> p;
        map<ll,ll> kol;
            for (i=0;i<n;i++){
                if (a[i]==1) s[i]='R';
                if (a[i]==r) s[i]='L';
                if (s[i]=='R') a[i]++;
                else a[i]--;
                mx=max(mx,a[i]);
                p[a[i]].insert(s[i]);
                kol[a[i]]++;
            }
            if (sz(p[mx])>1){
                if (mx==mxx){
                    r = mx;
                    if (kol[mx]==n){
                        cout << r << endl;
                        return 0;
                    }
                    break;
                }
            }
        }
//        cout << r << endl;


    }
    return 0;
}
