// TaskB.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <set>
#include <map>

using namespace std;

using ll = long long;
using ld = long double;

const int inf = 1e9 + 7;
const int mod = 1e9 + 7;

int t;
int n, m;
vector<int> a;
vector<int> ar;

int cnt0(int p, int d) {
	if (d == 1 && p == 0) {
		return 0;
	}
	if (d == 0) {
		return p;
	}
	return (m - p) * 2 + p;
}

int mx = 0;
int xt = 0;
int curt = 0;

void check() {
	if (a[0] == a[1]) {
		if (ar[0] == ar[1]) {
			if (t >= 2) {
				cout << m << '\n';
			}
			if (t == 3) {
				cout << 0 << '\n';
			}
			exit(0);
		}
		else {
			if (mx < a[0]) {
				mx = a[0];
				xt = curt;
			}
		}
	}
}

void move() {
	curt++;
	for (int i = 0; i < n; i++) {
		if (ar[i] == 0) {
			a[i]--;
		}
		else {
			a[i]++;
		}
		if (a[i] == 0 || a[i] == m - 1) {
			ar[i] ^= 1;
		}
	}
	check();
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> t;
	cin >> n >> m;
	a.resize(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		a[i]--;
	}
	string s;
	cin >> s;
	ar.resize(n);
	for (int i = 0; i < n; i++) {
		ar[i] = (s[i] == 'R');
	}
	if (cnt0(a[0], ar[0]) % 2 != cnt0(a[1], ar[1]) % 2) {
		cout << "No" << '\n';
		return 0;
	}
	cout << "Yes" << '\n';
	check();
	for (int i = 0; i < m * 2 - 2; i++) {
		move();
	}
	if (t >= 2) {
		cout << mx + 1 << '\n';
	}
	if (t >= 3) {
		cout << 1 << '\n';
		cout << xt << ' ' << mx + 1 << '\n';
	}
}
