#include <bits/stdc++.h>
using namespace std;

int n, m;
int sheep_tick(int sh, int curM) {
    int z = sh % 2, j = sh / 2;
    assert(j < curM);
    if (j == 0) z = 1;
    if (j == curM - 1) z = 0;
    j += (z == 1 ? 1 : -1);
    if (j == 0) z = 1;
    if (j == curM - 1) z = 0;
    return j * 2 + z;
}

int only_change_dir(int sh, int curM) {
    int z = sh % 2, j = sh / 2;
    assert(j < curM);
    if (j == 0) z = 1;
    if (j == curM - 1) z = 0;
    return j * 2 + z;
}

vector<int> tick_all(const vector<int> &a) {
    vector<int> b;
    for (int i = 0; i < (int) a.size() - 1; ++i) {
        b.push_back(sheep_tick(a[i], a.back()));
    }
    b.push_back(a.back());
    return b;
}

vector<int> shrink(const vector<int> &a) {
    vector<int> b;
    int curM = a.back();
    for (int i = 0; i < (int) a.size() - 1; ++i) {
        if (a[i] / 2 == curM - 1) {
            return {};
        }
        b.push_back(only_change_dir(a[i], curM - 1));
    }
    b.push_back(curM - 1);
    return b;
}

set<vector<int>> used;
void dfs(vector<int> a) {
    if (used.count(a)) return;
    used.insert(a);
    if (a.back() == 1) return;
    while (!a.empty()) {
        dfs(tick_all(a));
        a = shrink(a);
    }
}

bool stateSemiGood(const vector<int> &a) {
    for (int i = 0; i < (int) a.size() - 1; ++i) {
        if (a[i] / 2 != a[0] / 2) {
            return false;
        }
    }
    return true;
}

bool stateGood(const vector<int> &a) {
    for (int i = 0; i < (int) a.size() - 1; ++i) {
        if (a[i] != a[0]) {
            return false;
        }
    }
    return true;
}


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

    int svozzzz;
    cin >> svozzzz >> n >> m;
    vector<int> initial(n);
    for (int i = 0; i < n; ++i) {
        int j;
        cin >> j;
        initial[i] = 2 * (j - 1);
    }
    string s;
    cin >> s;
    for (int i = 0; i < n; ++i) {
        initial[i] += s[i] == 'R';
    }
    initial.push_back(m);
    int ans = -1;
    int whenCut = -1;
    for (int tt = 0; tt < m; ++tt) {
        // for (int sh : initial) {
        //     if (sh % 2 == 0) {
        //         cout << "<-";
        //     }
        //     cout << sh / 2;
        //     if (sh % 2 == 1) {
        //         cout << "->";
        //     }
        //     cout << " ";
        // }
        // cout << "\n";
        if (stateGood(initial)) {
            ans = m;
            whenCut = -1;
            break;
        }
        if (stateSemiGood(initial)) {
            if (initial[0] / 2 + 1 > ans) {
                ans = initial[0] / 2 + 1;
                whenCut = tt;
            }
        }
        initial = tick_all(initial);
    }
    if (ans == -1) {
        cout << "No\n";
    } else {
        cout << "Yes\n";
        if (svozzzz >= 2) {
            cout << ans << "\n";
            if (svozzzz >= 3) {
                if (whenCut == -1 || ans == m) {
                    cout << "0\n";
                } else {
                    cout << "1\n";
                    cout << whenCut << " " << ans << "\n";
                }
            }
        }
    }
}