#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <unordered_map>
#include <cassert>

using namespace std;
using ll = long long;

const int mod = 998244353;
const ll inf = 1e18;
const int INF = 1e9;

#define vec vector
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define rev reverse
#define umap unordered_map
#define pll pair<ll, ll>
#define pii pair<int, int>
#define len(a) int(a.size())
#define pb push_back
#define int long long


void solve() {
	int tp;
	cin >> tp;
	int n;
	ll m;
	cin >> n >> m;
	vec<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(all(a));
	string s;
	cin >> s;
	bool ok = true;
	for (int i = 0; i + 1 < n; i++) {
		if (abs(a[i] - a[i + 1]) % 2 == 1) ok = false;
	}
	if (!ok) {
		cout << "No\n";
		return;
	}
	int ans = 0;
	int mx = -1, moment = -1;
	for (int pos = m; pos >= 1; pos--) {
		vec<vec<int>> var;
		for (int i = 0; i <= 1; i++) {
			vec<int> sum;
			if (a[i] <= pos) {
				if (s[i] == 'L') {
					sum.pb(a[i] - 1 + pos - 1);
					sum.pb(a[i] - 1 + m - 1 + (m - pos));
				}
				else {
					sum.pb(pos - a[i]);
					sum.pb(m - a[i] + (m - pos));
				}
			}
			else if (a[i] >= pos) {
				if (s[i] == 'R') {
					sum.pb(m - a[i] + (m - pos));
					sum.pb(m - a[i] + m - 1 + (pos - 1));
				}
				else {
					sum.pb(a[i] - pos);
					sum.pb(a[i] - 1 + pos - 1);
				}
			}
			var.pb(sum);
		}
		vec<int> vc1 = var[0], vc2 = var[1];
		for (int m1 : vc1) {
			for (int m2 : vc2) {
				if (m1 == m2) {
					mx = pos;
					moment = m1;
					break;
				}
			}
		}
		if (mx != -1) break;
	}
	cout << "Yes\n";
	if (tp == 1) return;
	cout << mx << "\n";
	if (tp == 2) return;
	if (mx == m) {
		cout << 0 << "\n";
		return;
	}
	cout << 1 << "\n";
	cout << moment << " " << mx << "\n";
}

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int test = 1;
	// cin >> test;
	while (test--) {
		solve();
	}
}