// 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) {
    if (count(tm.begin(), tm.end(), tm[0]) == n) {
      if (T >= 2) {
        cout << m << "\n";
      }
      if (T >= 3) {
        cout << 0 << "\n";
      }
    } else {
      int delta = INT_MAX;
      long long add = 0;
      for (int i = 0; i < n; i++) {
        if (tm[i] <= m - 1) {
          delta = min(delta, m - 1 - tm[i]);
        }
      }
      if (delta != INT_MAX) {
        add += delta;
        for (int i = 0; i < n; i++) {
          tm[i] += delta;
          tm[i] %= 2 * (m - 1);
        }
      }
      delta = INT_MAX;
      for (int i = 0; i < n; i++) {
        if (tm[i] > m - 1) {
          delta = min(delta, 2 * (m - 1) - tm[i]);
        }
      }
      if (delta != INT_MAX) {
        add += delta;
        for (int i = 0; i < n; i++) {
          tm[i] += delta;
          tm[i] %= 2 * (m - 1);
        }
      }
      vector<int> pos;
      for (int i = 0; i < n; i++) {
        pos.push_back(min(tm[i], 2 * (m - 1) - tm[i]));
      }
      sort(pos.begin(), pos.end());
      if (T >= 2) {
        cout << (pos[0] + pos[1]) / 2 + 1 << "\n";
      }
      if (T >= 3) {
        cout << "1\n";
        cout << add + (pos[1] - pos[0]) / 2 << " " << (pos[0] + pos[1]) / 2 + 1 << "\n";
      }
    }
  }
}
