// Forza Ferrari!
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int T;
  cin >> T;
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  for (int &x : a) {
    cin >> x;
    --x;
  }
  string s;
  cin >> s;
  bool good = true;
  vector<int> tm(n);
  for (int i = 0; i < n; i++) {
    tm[i] = s[i] == 'R' ? a[i] : m - 1 - a[i] + m - 1;
  }
  for (int i = 0; i < n; i++) {
    good &= tm[i] % 2 == tm[0] % 2;
  }
  cout << (good ? "Yes\n" : "No\n");
  if (good && T == 2) {
    cout << (m + 1) / 2 << "\n";
  }
}
