#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int X[10], Y[10], c[10];
int main() {
  int i, xx, yy;
  char cc;
  scanf("%d %d %d", &n, &x, &y);
  for (i = 1; i <= 6; ++i) X[i] = x, Y[i] = y;
  while (n--) {
    getchar();
    scanf("%c %d %d", &cc, &xx, &yy);
    if (xx == x) {
      if (yy < y) {
        if (Y[1] == y || Y[1] < yy) Y[1] = yy, c[1] = cc;
      } else if (yy > y) {
        if (Y[2] == y || Y[2] > yy) Y[2] = yy, c[2] = cc;
      }
    } else if (yy == y) {
      if (xx < x) {
        if (X[1] == x || X[1] < xx) X[1] = xx, c[3] = cc;
      } else if (xx > x) {
        if (X[2] == x || X[2] > xx) X[2] = xx, c[4] = cc;
      }
    } else if (xx - yy == x - y) {
      if (xx < x) {
        if (X[3] == x || X[3] < xx) X[3] = xx, c[5] = cc;
      } else if (xx > x) {
        if (X[4] == x || X[4] > xx) X[4] = xx, c[6] = cc;
      }
    } else if (xx + yy == x + y) {
      if (xx < x) {
        if (X[5] == x || X[5] < xx) X[5] = xx, c[7] = cc;
      } else if (xx > x) {
        if (X[6] == x || X[6] > xx) X[6] = xx, c[8] = cc;
      }
    }
  }
  for (i = 1; i <= 2; ++i)
    if (Y[i] != y && (c[i] == 'R' || c[i] == 'Q')) {
      puts("YES");
      return 0;
    }
  for (i = 1; i <= 2; ++i)
    if (X[i] != x && (c[i + 2] == 'R' || c[i + 2] == 'Q')) {
      puts("YES");
      return 0;
    }
  for (i = 3; i <= 6; ++i)
    if (X[i] != x && (c[i + 2] == 'B' || c[i + 2] == 'Q')) {
      puts("YES");
      return 0;
    }
  puts("NO");
  return 0;
}
