#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()
{
    ll t, n, m;
    cin >> t >> n >> m;
    vector<ll> a(n);
    string s;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        --a[i];
    }
    cin >> s;
    int cnt0 = 0, cnt1 = 0;
    for (int i = 0; i < n; ++i)
    {
        ll 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";
    ll md = 2 * m - 2;
    if (t == 1) return;
    sort(all(a));
    ll mx = a[n - 1], mn = a[0];
    if (mn == mx)
    {
        throw(0);
        cout << m << '\n';
        if (t == 2) return;
        cout << "0\n";
        return;
    }
    ll i = (md - (a[n - 1] - a[0])) / 2;
    cout << i + 1 << '\n';
    if (t == 2) return;
    cout << n - 1 << "\n";
    for (int i = n - 2; i >= 0; --i)
    {
        ll ci = (md - (a[n - 1] - a[i])) / 2;
        cout << ci << ' ' << ci + 1 << '\n';
    }


    /*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;
}
