//#include "triangles.h"
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
using namespace std;
#define ll long long
#define ld long double
const ll INF = 1e18;
const int MOD = 1e9 + 7;
void solve() {
	int t; cin >> t;
	int n, m; cin >> n >> m;
	vector <int> a(n); for (int i = 0; i < n; ++i) cin >> a[i];
	string s; cin >> s;
	if (a[0] % 2 != a[1] % 2 != 0) {
		cout << "No\n";
		return;
	}
	cout << "Yes\n";
	if (t == 1) return;
	int x = a[0], y = a[1];
	int mx = 0, t = 0;
	for (int i = 0; i < 400000; ++i) {
		if (s[0] == 'L' && x == 1) s[0] = 'R';
		if (s[0] == 'R' && x == m) s[0] = 'L';
		if (s[1] == 'L' && x == 1) s[1] = 'R';
		if (s[1] == 'R' && x == m) s[1] = 'L';
		if (s[0] == 'R') x++;
		else x--;
		if (s[1] == 'R') y++;
		else y--;
		if (x == y) {
			if (x > mx) {
				mx = x;
				t = i + 1;
			}
		}
	}
	cout << mx << "\n";
	if (t == 2) return;
	cout << t << " " << mx << "\n";
} 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int TESTS = 1; //cin >> TESTS;
	while (TESTS--) solve();
}
