#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <numeric>
#include <cassert>
#include <vector>
#include <set>
#include <map>
#include <queue>

#define all(a) a.begin(), a.end()
#define int int64_t

const int INF = 1e18;

using namespace std;

int m;


int tim = 0;

void up(pair<int, int>& a, int kol) {
	if (a.first == 0) a.second = 1;
	if (a.first == m - 1) a.second = -1;
	int del = kol * a.second;
	if (a.first + del >= m) {
		a.first = m - (a.first + del + 1 - m);
		a.second = -1;
	} else if (a.first + del < 0) {
		a.first = -(a.first + del);
		a.second = 1;
	} else {
		a.first += del;
	}
}

int dist(pair<int, int> a) {
	if (a.second == -1) {
		return a.first;
	} else {
		return m - 1 - a.first;
	}
}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int T;
	cin >> T;
	int n;
	cin >> n >> m;
	vector<int> b(n);
	for (int i = 0; i < n; ++i) cin >> b[i];
	string s;
	cin >> s;
	vector<pair<int, int>> a;
	for (int i = 0; i < n; ++i) {
		if (s[i] == 'L') {
			a.push_back({ b[i] - 1, -1 });
		} else {
			a.push_back({ b[i] - 1, 1 });
		}
	}
	bool fl = true;
	for (int i = 1; i < n; ++i) {
		if (a[i - 1] != a[i]) fl = false;
	}
	if (fl) {
		cout << "Yes" << '\n';
		if (T >= 2) {
			cout << m << '\n';
		}
		if (T >= 3) {
			cout << 0 << '\n';
		}
	}
	pair<int, int> ans = { -1,-1 };
	int iter = 0;
	while (true) {
		if (++iter > 100) break;
		if (a[0].second == -1) swap(a[0], a[1]);
		if (a[0].first == a[1].first) {
			ans = max(ans, make_pair(a[0].first, tim));
			up(a[0], 1);
			up(a[1], 1);
			++tim;
			continue;
		}
		if (a[0].second != a[1].second && a[0].first < a[1].first) {
			int del = (a[1].first - a[0].first + 1) / 2;
			up(a[0], del);
			up(a[1], del);
			tim += del;
			continue;
		}
		int del = min(dist(a[0]), dist(a[1]));
		up(a[0], del);
		up(a[1], del);
		tim += del;
	}
	if (ans.first == -1) {
		cout << "No";
	} else {
		cout << "Yes" << '\n';
		if (T >= 2) {
			cout << ans.first + 1 << '\n';
		}
		if (T >= 3) {
			cout << 1 << '\n';
			cout << ans.second << " " << ans.first + 1 << '\n';
		}
	}
}