#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
long long int t,n,m,a[200005],otg=1e9,start,tim;
string s;
void shift(int ind,long long int tim)
{
    while(tim)
    {
        if(s[ind-1]=='L')
        {
            if(tim<a[ind])
            {
                a[ind]-=tim;
                break;
            }
            else
            {
                tim-=a[ind]-1;
                a[ind]=1;
                s[ind-1]='R';
            }
        }
        else
        {
            if(tim<=m-a[ind])
            {
                a[ind]+=tim;
                break;
            }
            else
            {
                tim-=m-a[ind];
                a[ind]=m;
                s[ind-1]='L';
            }
        }
    }
}
void resh1()
{
    if(s[0]=='R')start=m-a[1];
    if(s[0]=='L')start=(m-1)+(a[1]-1);
    for(int i=1;i<=n;i++)
    {
        shift(i,start);
    }
    cout<<m-(a[1]-a[2])/2<<endl;
}
void resh2()
{
    if(m==1||a[1]==a[2])
    {
        cout<<0<<endl;
        return;
    }
    tim=start;
    //cout<<a[1]<<" "<<a[2]<<endl;
    //cout<<s<<endl;
    if(s[1]=='R')
    {
        tim+=(a[1]-a[2])/2;
    }
    else
    {
        //cout<<m*2-2-(a[1]-a[2])/2<<endl;
        tim+=m*2-2-(a[1]-a[2])/2;
    }
    cout<<1<<endl;
    cout<<tim<<" "<<m-(a[1]-a[2])/2<<endl;
}
void resh3()
{
    int mi=n,br=0;
    sort(a+1,a+n+1);
    cout<<m-(a[n]-a[1])/2<<endl;
    if(t==2)exit(0);
    for(int i=1;i<=n;i++)
    {
        if(a[i]!=a[i+1])br++;
    }
    cout<<br-1<<endl;
    int st=n;
    while(a[st]==a[st-1])st--;
    for(int i=st-1;i>=1;i--)
    {
        if(a[i]==a[i-1])continue;
        cout<<m-a[n]+(a[n]-a[i])/2<<" "<<m-(a[n]-a[i])/2<<endl;
    }
    exit(0);
}
void read()
{
    cin>>t>>n>>m;
    int br1=0,br2=0,la=0;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        if(a[i]%2==0)br2++;
        else br1++;
    }
    cin>>s;
    for(int i=1;i<=n;i++)if(s[i-1]=='R')la++;
    if(la==0)
    {
        for(int i=1;i<=n;i++)
        {
            shift(i,m);
        }
    }
    if(t==1)
    {
        if(br1==n||br2==n)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    if(t==2)
    {
        if(br1==n||br2==n)
        {
            cout<<"Yes"<<endl;
            if(la==n)
            {
                resh3();
            }
            int bb=0;
            for(int i=1;i<=n;i++)
            {
                if(a[i]==a[i+1])bb++;
            }
            if(m==4)
            {
                if(bb==m)cout<<4<<endl;
                else cout<<3<<endl;
            }
            else if(m==3)
            {
                if(bb==m)cout<<3<<endl;
                else cout<<2<<endl;
            }
            else if(m==2)
            {
                cout<<2<<endl;
            }
            //resh1();
        }
        else cout<<"No"<<endl;
    }
    if(t==3)
    {
        if(br1==n||br2==n)
        {
            cout<<"Yes"<<endl;
            if(la==n)
            {
                resh3();
            }
            resh1();
            resh2();
        }
        else cout<<"No"<<endl;
    }
}
int main()
{
    speed();
    //test();
    read();
	return 0;
}
