#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>

using namespace std;
using ll = long long;

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(0);

	int t, n, m;
	cin >> t >> n >> m;
	vector<int> a(n);
	string s;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	cin >> s;
	set<int> st;
	for (int i = 0; i < n; ++i) {
		if (s[i] == 'L') {
			st.insert(a[i] - 1);
		}
		else if (a[i] == 1) {
			st.insert(0);
		}
		else {
			st.insert(2 * n - a[i] - 1);
		}
	}
	int cn = 0;
	for (auto i : st) {
		if (i % 2 == 0) {
			cn |= 1;
		}
		else {
			cn |= 2;
		}
	}
	if (cn == 3) {
		cout << "No\n";
	}
	else {
		cout << "Yes\n";
	}
	if (t >= 2) {
		vector<int> vv;
		for (auto i : st) {
			vv.push_back(i);
		}
		int rs = 2 * m - 3 - vv.back() + vv[0];
		for (int i = 0; i + 1 < vv.size(); ++i) {
			rs = max(rs, vv[i + 1] - vv[i]);
		}
		cout << rs / 2;
	}
	return 0;
}
