#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <cmath>
#include <assert.h>

using namespace std;

#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#pragma GCC target("popcnt")

#define int long long
#define all(a) a.begin(),a.end()
#define endl '\n'
#define pii pair<int, int>
#define pb emplace_back
typedef long double ld;
typedef long long ll;

int const N = 1e5 + 5, M = 1e2 + 5, lg = 23, INF = 2e9;
int mod = 998244353, mod2 = 1e9 + 9;
int P = 1e9 + 7;

struct point {
	int x, d;
};

int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int T; cin >> T;

	int n, m; cin >> n >> m;
	vector<point> a(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i].x;
	}
	string s; cin >> s;
	if (a[0].x > a[1].x) {
		swap(a[0], a[1]);
	}
	for (int i = 0; i < n; ++i) {
		if (s[i] == 'R') {
			a[i].d = 1;
		}
		else a[i].d = 0;
	}

	if ((a[1].x - a[0].x) % 2 == 1) {
		cout << "No\n";
		return 0;
	}
	cout << "Yes\n";
	
	auto x = a[0], y = a[1];

	int tm = 0;
	
	if (x.x != 1 && y.x != m) {
		while (1) {
			if (x.x == y.x) {
				if (x.x <= (m + 1) / 2) continue;
				int del = min(m - x.x, x.x - 1);
				if (T >= 2) cout << m - del << endl;
				if (T== 3) cout << 1 << endl << tm << ' ' << m - del;
				return 0;
			}
			tm += 1;
			if (x.x == 1) x.d = 1;
			if (x.x == m) x.d = 0;
			if (x.d == 1) x.x += 1;
			else x.x -= 1;
			
			if (y.x == 1) y.d = 1;
			if (y.x == m) y.d = 0;
			if (y.d == 1) y.x += 1;
			else y.x -= 1;
		}
	}
	

	int delta = 0;

	if (x.d == 0 and y.d == 1) {
		if (x.x - 1 < m - y.x) {
			delta += x.x - 1;
			x.x -= delta;
			y.x += delta;
			x.d = 1;
			if (y.x == m) y.x = 0;
		}
		else {
			delta += m - y.x;
			x.x -= delta;
			y.x += delta;
			y.d = 0;
			if (x.x == 1) x.d = 1;
		}
	}
	


	if (x.d == y.d) {
		if (x.d == 1) {
			delta += m - y.x;
			int r = m - y.x;
			y.x += r;
			x.x += r;
		}
		else {
			delta += x.x - 1;
			int r = x.x - 1;
			x.x -= r;
			y.x -= r;
		}
	}

	int res = (x.x + y.x) / 2;

	int t = (y.x - x.x) / 2;

	int del = min(m - res, res - 1);

	if (T >= 2) cout << m - del << endl;

	if (T >= 3) cout << 1 << endl << t + delta << ' ' << m - del;

	return 0;
}