#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

const int MOD = 1e9 + 7;
const int Inf = 2e9;
const ll INF = 3e18;

int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  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;
  set <char> even, odd;
  for (int i = 0; i < n; i++) {
    if (a[i] % 2 == 0) even.insert(s[i]);
    else odd.insert(s[i]);
  }
  cout << (even.size() == 1 && odd.size() == 1 ? "NO\n" : "YES\n");
  return 0;
}