#define _CRT_SECURE_NO_WARNINGS


#include <iostream>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <deque>

using namespace std;
using ll=long long;
const ll inf = 1e18;



struct segtree {
	ll lb, rb;
	ll mn = inf;
	ll add = inf;
	segtree* l = 0, *r = 0;
	segtree(ll lb, ll rb) :lb(lb), rb(rb) {
		if (lb < rb) {
			ll m = lb + (rb - lb) / 2;
			l = new segtree(lb, m);
			r = new segtree(m + 1, rb);
		}
	}
	void push() {
		if (add != inf) {
			mn = min(mn, add);
			if (lb < rb) {
				l->add = min(l->add, add);
				r->add = min(r->add, add);
			}
			add = inf;
		}
	}
	ll get(ll lq, ll rq) {
		if (min(rb, rq) < max(lb, lq)) {
			return inf;
		}
		push();
		if (lb >= lq && rb <= rq) {
			return mn;
		}
		return min(l->get(lq, rq), r->get(lq, rq));
	}
	void upd(ll lq, ll rq, ll val) {
		if (min(rb, rq) < max(lb, lq)) {
			return;
		}
		push();
		if (lb >= lq && rb <= rq) {
			mn = min(mn, val);
			if (lb < rb) {
				l->add = min(l->add, val);
				r->add = min(r->add, val);
			}
			return;
		}
		l->upd(lq, rq, val);
		r->upd(lq, rq, val);
	}
};


ll a[200001];
int main() {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll t, n, m;
	cin >> t >> n >> m;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	string s;
	cin >> s;
	ll tt = abs(a[1] - a[2]);
	if (abs(a[1]-a[2]) % 2 != 0) {
		cout << "No" << "\n";
	}
	else {
		ll f = 0;
		ll g = 0;
		for (int j = 0; j <= 10000000;++j) {
			if (a[1] == a[2]) {
				if (a[1] > g) {
					g = a[1];
					f = j;
				}
			}
			if (s[0] == 'L') {
				a[1]--;
			}
			else {
				a[1]++;
			}
			if (s[1] == 'L') {
				a[2]--;
			}
			else {
				a[2]++;
			}
			if (a[1] == 1) {
				s[0] = 'L';
			}
			if (a[1] == m) {
				s[0] = 'R';
			}
			if (a[2] == 1) {
				s[1] = 'L';
			}
			if (a[2] == m) {
				s[1] = 'R';
			}
		}
		cout << "Yes" << "\n";
		if (t > 1) {
			cout << g << "\n";
		}
		if (t > 2) {
			
			if (f == 0) {
				cout << 0 << "\n";
			}
			else {
				cout << 1 << "\n";
				cout << f << " " << g<< "\n";
			}
		}
	}
}