#include<bits/stdc++.h>
using namespace std;
int main ()
{
    long long T;
    cin>>T;

    long long n, m;
    cin>>n>>m;

    long long br[2]={};

    vector<long long>v;

    for (long long i=0; i<n; i++)
    {
        long long x;
        cin>>x;
        v.push_back(x);
    }

    for (long long i=0; i<n; i++)
    {
        char dir;
        cin>>dir;

        if (dir=='R') br[(m-v[i]+m-1)%2]++;
        else br[(v[i]-1)%2]++;
    }

    if (br[0]!=0 && br[1]!=0)
    {
        cout<<"No"<<endl;
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<m/2+1<<endl;
        cout<<1<<endl;
        cout<<m-(m/2+1)<<" "<<m/2+1<<endl;
    }

    return 0;
}
