#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 2005;
const char ycl[4] = {'.', 'R', 'Y', 'B'};
bitset<N> a[N], ans;
bool A[N >> 1][2][2];
string ch;
int m;
int main() {
  int n = read(), k = read();
  for (int i = (int)(0); i <= (int)(n - 1); i++) A[i][0][0] = A[i][1][1] = 1;
  while (k--) {
    cin >> ch;
    int t = read();
    if (ch == "mix") {
      while (t--) {
        int p = read() - 1;
        for (int j = (int)(0); j <= (int)(1); j++)
          for (int o = (int)(0); o <= (int)(1); o++)
            a[m + j][p << 1 | o] = A[p][j][o];
      }
      cin >> ch;
      int re = 0;
      if (ch == "W")
        re = 0;
      else if (ch == "R")
        re = 1;
      else if (ch == "Y")
        re = 2;
      else
        re = 3;
      a[m][2 * n] = re & 1;
      a[m + 1][2 * n] = re >> 1;
      m += 2;
    } else {
      while (t--) {
        int p = read() - 1;
        if (ch == "RY")
          swap(A[p][0], A[p][1]);
        else {
          int t = ch == "RB";
          for (int j = (int)(0); j <= (int)(1); j++)
            A[p][t][j] ^= A[p][t ^ 1][j];
        }
      }
    }
  }
  int dq = 0;
  for (int i = (int)(0); i <= (int)(2 * n - 1); i++) {
    for (int j = (int)(dq); j <= (int)(m); j++)
      if (a[j][i]) {
        swap(a[j], a[dq]);
        break;
      }
    if (!a[dq][i]) continue;
    for (int j = (int)(dq + 1); j <= (int)(m); j++)
      if (a[j][i]) a[j] ^= a[dq];
    dq++;
  }
  for (int i = (int)(m - 1); i >= (int)(0); i--) {
    int jb = -1, sum = a[i][2 * n];
    for (int j = (int)(2 * n - 1); j >= (int)(i); j--)
      if (a[i][j]) {
        sum ^= a[i][j] & ans[j];
        jb = j;
      }
    if (jb >= 0)
      ans[jb] = sum;
    else if (sum) {
      puts("No");
      exit(0);
    }
  }
  puts("Yes");
  for (int i = (int)(0); i <= (int)(n - 1); i++)
    putchar(ycl[ans[2 * i] + (int)ans[2 * i + 1] * 2]);
}
