#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];
	string s;
	cin >> s;
	vec<int> arr = a;
	sort(all(arr));
	bool ok = true;
	for (int i = 0; i + 1 < n; i++) {
		if (abs(arr[i] - arr[i + 1]) % 2 == 1) ok = false;
	}
	if (!ok) {
		cout << "No\n";
		return;
	}
	cout << "Yes\n";
	if (tp == 1) return;
	int mx = -1, moment = -1;
	vec<int> nor;
	int id = 0;
	if (a[0] > a[1]) swap(a[0], a[1]), swap(s[0], s[1]);
	if (a[0] == 1) s[0] = 'R';
	if (a[1] == m) s[1] = 'L';
	if (s[0] == 'R' && s[1] == 'L') {
		id = (a[0] + a[1]) / 2;
	}
	else {
		if (s[0] == s[1]) {
			if (s[0] == 'L') {
				id = (a[0] + 2 * m - a[1]) / 2;
			}
			else {
				id = (a[1] - a[0] + 2) / 2;
			}
		}
		else {
			id = 2 * m - a[1] - a[0] + 2;
			id /= 2;
		}
	}
	nor.pb(id);
	nor.pb(m - id);
	sort(all(nor));
	rev(all(nor));
	for (int pos : nor) {
		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));
					sum.pb(m - a[i] + m - 1 + (pos - 1));
				}
			}
			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);
					sum.pb(a[i] - 1 + m - 1 + (m - pos));
				}
			}
			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 << 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();
	}
}