// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")

// #pragma clang __attribute__(optimize("O3,unroll-loops"))
// #pragma clang __attribute__(target("avx2,bmi,bmi2,popcnt,lzcnt"))

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

typedef long long ll;
typedef long double ld;
typedef __int128 lll;

const ll inf=1e18+1,mod=998244353;
const ld eps=1e-9,pi=acos(-1);
#define all(a) a.begin(), a.end()
#define mpp make_pair
#define F first
#define S second

mt19937_64 rng(234);

ll m;
void walkend(ll &i0,char &d0,ll &i1,char &d1) {

    ll mn=inf;
    if (d0=='L')
        mn=min(mn,i0-1);
    else
        mn=min(mn,m-i0);
    if (d1=='L')
        mn=min(mn,i1-1);
    else
        mn=min(mn,m-i1);

    if (d0=='L')
        i0-=mn;
    else
        i0+=mn;
    if (d1=='L')
        i1-=mn;
    else
        i1+=mn;

    if (i0==1)
        d0='R';
    if (i0==m)
        d0='L';
    if (i1==1)
        d1='R';
    if (i1==m)
        d1='L';
}

ll meet(ll i0,char d0,ll i1,char d1) {
    if (i0==i1&&d0==d1)
        return m;
    while (!(i0==m&&d0=='L'))
        walkend(i0,d0,i1,d1);
    if (d1=='L') {
        swap(i0,i1);
        swap(d0,d1);
        while (!(i0==m&&d0=='L'))
            walkend(i0,d0,i1,d1);
    }
    return (i0+i1)/2;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll TTT;cin>>TTT;
    ll n;cin>>n>>m;
    vector<ll>a(n);
    ll k0=0,k1=0;
    for (auto &i:a) {
        cin>>i;
        if (i%2)
            k1++;
        else
            k0++;
    }
    string d;cin>>d;
    if (k0&&k1) {
        cout<<"No";
        return 0;
    }
    cout<<"Yes\n";
    if (TTT==1)
        return 0;
    ll ans=n;
    for (ll i=0;i<n-1;i++)
        for (ll j=i+1;j<n;j++) {
            ans=min(ans,meet(a[i],d[i],a[j],d[j]));
        }
    cout<<ans;
}