#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <random>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;
using ll = long long;
using ld = long double;

const int inf = 1e9 + 10;

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int T, n, m;
	cin >> T >> n >> m;
	vector<int> a(n);
	vector<bool> dir(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (i > 0 && a[i] % 2 != a[i - 1] % 2) {
			cout << "No";
			return 0;
		}
	}
	for (int i = 0; i < n; i++) {
		char c;
		cin >> c;
		dir[i] = (c == 'R');
	}
	cout << "Yes\n";
	if (T == 1)
		return 0;
}
