#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
#define len(v) (int)v.size()

using namespace std;
using ll = long long;
using ld = long double;

void solve()
{
    int t, n, m;
    cin >> t >> n >> m;
    vector<int> a(n);
    string s;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    cin >> s;
    int cnt0 = 0, cnt1 = 0;
    for (int i = 0; i < n; ++i)
    {
        int pos = a[i];
        if (s[i] == 'L')
        {
            pos = (m - 1 - a[i]) + m - 1;
        }
        if (pos % 2 == 0)
        {
            ++cnt0;
        } else
        {
            ++cnt1;
        }
    }
    if (cnt0 != 0 && cnt1 != 0)
    {
        cout << "No";
        return;
    }
    cout << "Yes\n";
    if (t == 1) return;
    int pos0 = a[0], pos1 = a[1];
    if (s[0] == 'L')
    {
        pos0 = (m - 1 - a[0]) + m - 1;
    }
    if (s[1] == 'L')
    {
        pos1 = (m - 1 - a[1]) + m - 1;
    }
    int op0 = pos0, op1 = pos1;
    pos1 = (pos1 - pos0 + 2 * m - 2) % (2 * m - 2);
    ll md = 2 * m - 2;
    if ((md - 1 - pos1) % 2 == 0)
    {
        int i = (md - 1 - pos1) / 2;
        cout << i + 1 << '\n';
        if (t == 2) return;
        cout << "1\n";
        cout << (md - op0) % md + i << ' ' << i + 1;
        return;
    } else
    {
        pos0 = (op0 - op1 + md) % md;

        return;
    }
    throw(0);

    /*if (m % 2 == 0)
    {
        cout << "No";
        return;
    }
    cout << "Yes\n";
    if (t == 1) return;
    cout << (m + 1) / 2 << "\n";
    if (t == 2) return;
    cout << "1\n";
    cout << m / 2 << ' ' << (m + 1) / 2;*/
}

int main()
{
    cin.tie(0)->sync_with_stdio(0);
    int t = 1;
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);

    //cin >> t;

    while (t--)
    {
        solve();
        cout << '\n';
    }
    return 0;
}
