#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    int n,m;
    cin >> n >> m;
    int a[n];
    bool c = 0,nc = 0;
    for(int i = 0;i < n;++i)
    {
        cin >> a[i];
        c |= (a[i]%2 == 0);
        nc |= (a[i]%2 == 1);
    }
    string s;
    cin >> s;
    set<pair<char,int>> gr;
    for(int i = 0;i < s.size();++i)
    {
        gr.insert({s[i],a[i]});
        if(a[i] == 1 && s[i] == 'L')
            s[i] = 'R';
        if(a[i] == m && s[i] == 'R')
            s[i] = 'L';
    }
    cout << ((!(c & nc)) ? "Yes\n" : "No\n");
    if(t >= 2 && (!(c & nc)))
    {
        vector<int> numbers;
        for(auto [a,b] : gr)
        {
            numbers.push_back((a == 'R' ? b-1 : m-b+m-1));
        }
        sort(numbers.begin(),numbers.end());
        vector<int> diff;
        for(int i = 0;i < numbers.size();++i)
        {
            int l = numbers[i];
            int r = numbers[(i+1) % numbers.size()];
            diff.push_back(min((r-l+(2*(m-1)))%(2*(m-1)),(l-r+(2*(m-1)))%(2*(m-1))));
        }
        sort(diff.begin(),diff.end());
        diff.pop_back();
        int ans = m;
        for(int i = 0;i < diff.size();++i)
        {
            ans -= diff[i] / 2;
        }
        cout << ans << "\n";
    }
    return 0;
}