#include <bits/stdc++.h>
using namespace std;
struct qq {
  char c;
  long long dis;
} a[500050], b[500050], c[500050], d[500050], e[500050], f[500050], g[500050],
    h[500050];
int cmp(qq a, qq b) { return a.dis < b.dis; }
int main() {
  int n;
  cin >> n;
  int x, y;
  cin >> x >> y;
  int fa = 0, fb = 0, fc = 0, fd = 0, fe = 0, ff = 0, fg = 0, fh = 0;
  for (int i = 0; i < n; i++) {
    int xx, yy;
    char cc;
    getchar();
    scanf("%c%d%d", &cc, &xx, &yy);
    xx -= x;
    yy -= y;
    if (xx == 0) {
      if (yy < 0)
        a[fa].c = cc, a[fa++].dis = -yy;
      else
        b[fb].c = cc, b[fb++].dis = yy;
    }
    if (yy == 0) {
      if (xx < 0)
        c[fc].c = cc, c[fc++].dis = -xx;
      else
        d[fd].c = cc, d[fd++].dis = xx;
    }
    if (xx == yy) {
      if (yy < 0) {
        e[fe].c = cc, e[fe++].dis = -xx;
      } else {
        f[ff].c = cc, f[ff++].dis = xx;
      }
    }
    if (xx == -yy) {
      if (yy < 0) {
        g[fg].c = cc, g[fg++].dis = xx;
      } else {
        h[fh].c = cc, h[fh++].dis = -xx;
      }
    }
  }
  sort(a, a + fa, cmp);
  sort(b, b + fb, cmp);
  sort(c, c + fc, cmp);
  sort(d, d + fd, cmp);
  sort(e, e + fe, cmp);
  sort(f, f + ff, cmp);
  sort(g, g + fg, cmp);
  sort(h, h + fh, cmp);
  if (a[0].c == 'R' || a[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  if (b[0].c == 'R' || b[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  if (c[0].c == 'R' || c[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  if (d[0].c == 'R' || d[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  if (e[0].c == 'B' || e[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  if (f[0].c == 'B' || f[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  if (g[0].c == 'B' || g[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  if (h[0].c == 'B' || h[0].c == 'Q') {
    printf("YES\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}
