#include <bits/stdc++.h>
using namespace std;
struct Point {
  char t;
  int x, y;
};
Point c[500010];
int main() {
  int n;
  scanf("%d", &n);
  int x, y;
  scanf("%d %d", &x, &y);
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c %d %d", &c[i].t, &c[i].x, &c[i].y);
    getchar();
  }
  int dis[10];
  for (int i = 0; i < 10; i++) dis[i] = 0x7fffffff;
  bool flag = false;
  for (int i = 0; i < n; i++) {
    char nc = c[i].t;
    int nx = c[i].x, ny = c[i].y;
    if (nc == 'B') {
      if (nx == x && ny > y) dis[0] = min(dis[0], ny - y);
      if (nx == x && ny < y) dis[4] = min(dis[4], y - ny);
      if (ny == y && nx > x) dis[2] = min(dis[2], nx - x);
      if (ny == y && nx < x) dis[6] = min(dis[6], x - nx);
    } else if (nc == 'R') {
      if (nx - x == ny - y && nx - x > 0) dis[1] = min(dis[1], ny - y);
      if (nx - x == ny - y && nx - x < 0) dis[5] = min(dis[5], y - ny);
      if (nx - x == y - ny && nx - x > 0) dis[3] = min(dis[3], y - ny);
      if (x - nx == ny - y && nx - x < 0) dis[7] = min(dis[7], ny - y);
    }
  }
  for (int i = 0; i < n; i++) {
    char nc = c[i].t;
    int nx = c[i].x, ny = c[i].y;
    if (nx == x && ny > y && nc != 'B' && dis[0] > ny - y) {
      flag = true;
      break;
    } else if (nx == x && ny < y && nc != 'B' && dis[4] > y - ny) {
      flag = true;
      break;
    } else if (nx > x && ny == y && nc != 'B' && dis[2] > nx - x) {
      flag = true;
      break;
    } else if (nx < x && ny == y && nc != 'B' && dis[6] > x - nx) {
      flag = true;
      break;
    } else if (nx - x == ny - y && nx - x > 0 && nc != 'R' && dis[1] > ny - y) {
      flag = true;
      break;
    } else if (nx - x == ny - y && nx - x < 0 && nc != 'R' && dis[5] > y - ny) {
      flag = true;
      break;
    } else if (nx - x == y - ny && nx - x > 0 && nc != 'R' && dis[3] > y - ny) {
      flag = true;
      break;
    } else if (x - nx == ny - y && nx - x < 0 && nc != 'R' && dis[7] > ny - y) {
      flag = true;
      break;
    }
  }
  printf("%s\n", flag ? "YES" : "NO");
  return 0;
}
