#ifdef ONPC
    #define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>

using namespace std;

#define all(v) begin(v), end(v)

using ll = long long;

const ll INF = 1e18L + 10;

void test_case() {
    int t, n, m;
    cin >> t >> n >> m;
    vector<int> a(n);
    for (auto &i : a) {
        cin >> i; i--;
    }
    string s;
    cin >> s;

    for (int i = 0; i < n; ++i) {
        if (s[i] == 'L') {
            if (a[i] == 0) {
                s[i] = 'R';
            }
        } else {
            if (a[i] == m - 1) {
                s[i] = 'L';
            }
        }
    }

    auto next = [&]() {
        for (int i = 0; i < n; ++i) {
            if (s[i] == 'L') {
                a[i]--;
                if (a[i] == 0) {
                    s[i] = 'R';
                }
            } else {
                a[i]++;
                if (a[i] == m - 1) {
                    s[i] = 'L';
                }
            }
        }
    };

    assert(n == 2);
    pair<ll, ll> ans = {-INF, -INF};
    for (int i = 0; i <= 1e6; ++i, next()) {
        if (a[0] == a[1]) {
            ans = max(ans, make_pair<ll, ll>(a[0] + 1, i));
        }
    }

    if (ans.second != -INF) {
        cout << "Yes" << '\n';
        if (t >= 2) {
            cout << ans.first << '\n';
            if (t >= 3) {
                cout << format("1\n{} {}", ans.second, ans.first);
            }
        }
    } else {
        cout << "No" << '\n';
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
//    cin >> t;
    while (t--) {
        test_case();
    }

    return 0;
}
