#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define int ll


int ans = 0;

const int inf = 1e18;

const int C = 10;

void go(vector<int> &a, vector<int> &mv, int r, int t) {
    if (*max_element(a.begin() + 1, a.end()) == *min_element(a.begin() + 1, a.end()) &&
        *max_element(mv.begin() + 1, mv.end()) == *min_element(mv.begin() + 1, mv.end())) {
        ans = max(ans, r);
    }
    if (t >= C || r <= ans) {
        return;
    }
    for (int nr = *max_element(a.begin(), a.end()); nr < r; nr++) {
        go(a, mv, nr, t + 1);
    }
    auto ma = a;
    auto mmv = mv;
    for (int i = 1; i < a.size(); i++) {
        a[i] += mv[i];
        if (a[i] > r || a[i] < 1) {
            mv[i] *= -1;
            a[i] += mv[i] * 2;
        }
    }
    go(a, mv, r, t + 1);
    a = ma;
    mv = mmv;
}

void solve() {
    int n, m, T;
    cin >> T >> n >> m;
    vector<int> a(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        if (i > 1 && a[i] % 2 != a[i - 1] % 2) {
            cout << "No";
            return;
        }
    }
    vector<int> mv(n + 1);
    char xc;
    for (int i = 1; i <= n; i++) {
        cin >> xc;
        if (xc == 'L') {
            mv[i] = -1;
        } else {
            mv[i] = 1;
        }
    }
    cout << "Yes\n";
    vector<pair<int, int> > ops;
    int t = 0;
    for (int i = 0; i <= m * 2; i++) {
        if (a[1] == a[2] && a[1] > ans) {
            ans = a[1];
            ops = {{t, a[1]}};
        }
        if (mv[1] == mv[2]) {
            int d = inf;
            if (mv[1] == -1) {
                d = min(a[1] - 1, a[2] - 1);
            } else {
                d = min(m - a[1], m - a[2]);
            }
            a[1] += mv[1] * d;
            a[2] += mv[2] * d;
            t += d;
        } else {
            if (a[1] > a[2]) {
                swap(a[1], a[2]);
                swap(mv[1], mv[2]);
            }
            if (mv[1] == -1) {
                int d = min(a[1], m - a[2]);
                a[1] += mv[1] * d;
                a[2] += mv[2] * d;
                t += d;
            } else {
                int d = (a[2] - a[1]) / 2;
                a[1] += mv[1] * d;
                a[2] += mv[2] * d;
                t += d;
            }
        }
        if (a[1] == 1) {
            mv[1] = 1;
        }
        if (a[1] == m) {
            mv[1] = -1;
        }
        if (a[2] == 1) {
            mv[2] = 1;
        }
        if (a[2] == m) {
            mv[2] = -1;
        }
    }
    if (!ops.empty() && ops.back().second == m) {
        ops.pop_back();
    }
    if (T >= 2) {
        cout << ans << "\n";
        if (T >= 3) {
            cout << ops.size() << "\n";
            for (auto [x, y]: ops) {
                cout << x << " " << y << "\n";
            }
        }
    }
    /* all R
    int t = 0;
    sort(a.begin(), a.end());
    for (int i = n; i >= 1; i--) {
        a[i] += t;
        if (i == n) {
            int td = m - a[i];
            t += td;
        } else {
            int td = (m - a[i]) / 2;
            t += td;
            m -= td;
            if (td > 0)
                ops.emplace_back(t, m);
        }
    }
    if (T >= 2) {
        cout << m << "\n";
        if (T >= 3) {
            cout << ops.size() << "\n";
            for (auto [x,y]: ops) {
                cout << x << " " << y << "\n";
            }
        }
    }
    return;
    */
    /*
    if (T >= 2) {
        cout << (m + 1) / 2 << "\n";
        if (T >= 3) {
            cout << 1 << "\n";
            cout << m / 2 << " " << (m + 1) / 2;
        }
    }
    */
}


signed main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    for (int ts = 1; ts <= t; ts++) {
        solve();
    }
}
