#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <deque>
#include <stack>
#include <queue>
#include <array>
using namespace std;
using ll = long long;
using ld = long double;
#define endl '\n'
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int t; cin >> t;
	int n, m; cin >> n >> m; vector<int> v(n);
	for (auto& i : v) cin >> i;
	string s; cin >> s;
	bool ch = 0, nch = 0;
	for (int i = 0; i < n; i++) {
		if (v[i] % 2 == 0) ch = 1;
		if (v[i] % 2 == 1) nch = 1;
	}
	if (ch == 1 && nch == 1) {
		cout << "No\n"; exit(0);
	}
	else {
		cout << "Yes\n";
	}
	if (t == 1) exit(0);
	if (v[0] > v[1]) swap(v[0], v[1]), swap(s[0], s[1]);
	int t0 = 0;
	if (s[0] == 'L') {
		int tm = v[0] - 1; v[0] = 1; s[0] = 'R'; t0 += tm;
		if (s[1] == 'L') {
			v[1] -= tm;
		} else {
			v[1] += tm;
			if (v[1] > m) {
				v[1] = m - (v[1] - m); s[1] = 'L';
			}
		}
	}
	if (s[1] == 'R') {
		int tm = m - v[1]; v[1] = m; s[1] = 'L';
		t0 += tm;
		v[0] += tm;
	}
	int res = (v[0] + v[1]) / 2;
	t0 += (res - v[0]);
	v[0] = res; v[1] = res;
	if (s[0] == s[1] || res >= m / 2 + 1) {
		cout << res << endl;
		if (t == 2) {
			exit(0);
		}
		if (res == m) {
			cout << 0; exit(0);
		}
		cout << 1 << endl << t0 << " " << res;
	} else {
		res = m - res + 1; t0 += m - 1;
		cout << res << endl;
		if (t == 2) {
			exit(0);
		}
		if (res == m) {
			cout << 0; exit(0);
		}
		cout << 1 << endl << t0 << " " << res;
	}
	return 0;
}
