#include <bits/stdc++.h>
using namespace std;
typedef struct point {
  long long int x, y;
  char p;
} pt;
pt P[500011];
long long int Kx, Ky;
pt closest[10];
long long int get_direction(long long int i) {
  if (Kx == P[i].x) {
    if (Ky < P[i].y)
      return 1;
    else
      return 5;
  } else if (Ky == P[i].y) {
    if (Kx < P[i].x)
      return 3;
    else
      return 7;
  } else if (Kx - P[i].x == Ky - P[i].y) {
    if (P[i].x > Kx)
      return 2;
    else
      return 6;
  } else if (Kx - P[i].x + Ky - P[i].y == 0) {
    if (Kx < P[i].x)
      return 4;
    else
      return 8;
  } else
    return -1;
}
int main() {
  long long int n;
  scanf("%lld", &n);
  scanf("%lld%lld", &Kx, &Ky);
  for (long long int i = 0; i < n; i++) {
    char temp[10];
    scanf("%s%lld%lld", temp, &P[i].x, &P[i].y);
    P[i].p = temp[0];
  }
  for (long long int i = 0; i < 10; i++) closest[i].p = '?';
  long long int direction, flag = 0;
  for (long long int i = 0; i < n; i++) {
    direction = get_direction(i);
    if (direction != -1) {
      if (closest[direction].p == '?')
        closest[direction] = P[i];
      else if ((closest[direction].x - Kx) * (closest[direction].x - Kx) +
                   (closest[direction].y - Ky) * (closest[direction].y - Ky) >
               (P[i].x - Kx) * (P[i].x - Kx) + (P[i].y - Ky) * (P[i].y - Ky))
        closest[direction] = P[i];
    }
  }
  if (closest[1].p == 'R' || closest[3].p == 'R' || closest[5].p == 'R' ||
      closest[7].p == 'R')
    flag = 1;
  if (closest[2].p == 'B' || closest[4].p == 'B' || closest[6].p == 'B' ||
      closest[8].p == 'B')
    flag = 1;
  for (long long int i = 1; i <= 8; i++) {
    if (closest[i].p == 'Q') flag = 1;
  }
  if (flag == 1)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
