#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
using namespace std;

#define ll long long
#define vc vector
#define db double
#define str string
#define its(a) (a).begin(), (a).end()
#define itsr(a) (a).rbegin(), (a).rend()
#define sz(a) (a).size()
#define tstr to_string
#define scan(a) for (auto &_i:a) cin >> _i;

const ll MOD = 998244353;
const ll INF = 1e18 + 18;

tuple<ll, ll, ll> operator +(const tuple<ll, ll, ll>& a, const tuple<ll, ll, ll>& b) {
	return { max(get<0>(a), get<0>(b)), min(get<1>(a), get<1>(b)), max(get<2>(a), get<2>(b)) };
}

void solve() {
	ll T; cin >> T;
	ll n, m; cin >> n >> m;
	vc<ll> a(n);
	scan(a);

	str s; cin >> s;
	for (int i = 1; i < n; ++i) {
		if (a[i] % 2 != a[i - 1] % 2) {
			cout << "No\n";
			return;
		}
	}
	cout << "Yes\n";

	ll r = abs(a[1] - a[0]);

	ll p1 = a[0] - 1, p2 = a[1] - 1;
	tuple<ll, ll, ll> mx = { -1, -1, -1 };
	for (int i = 0; i < 5e6; ++i) {
		if (p1 == p2) {
			mx = max(mx, { p1 + 1, -i, p1 + 1 });
		}

		if (s[0] == 'L') {
			if (p1 == 0) p1 = 1, s[0] = 'R';
			else p1--;
		}
		else {
			if (p1 == m - 1) p1 = m - 2, s[0] = 'L';
			else p1++;
		}
		if (s[1] == 'L') {
			if (p2 == 0) p2 = 1, s[1] = 'R';
			else p2--;
		}
		else {
			if (p2 == m - 1) p2 = m - 2, s[1] = 'L';
			else p2++;
		}


	}
	if (T >= 2) {
		cout << get<0>(mx) << '\n';
	}
	if (T >= 3) {
		cout << "1\n";
		cout << -get<1>(mx) << " " << get<0>(mx) << '\n';
	}
}

int main()
{
	cin.tie(0)->sync_with_stdio(0);

	ll _t = 1;
	//cin >> _t;
	while (_t--)
		solve();
}
