#include <bits/stdc++.h>
using namespace std;
struct node {
  char s[5];
  int x, y;
  long long int dis;
} a[500050];
int x, y;
int vis[8];
int cmp(node a, node b) { return a.dis < b.dis; }
int main() {
  int n;
  while (~scanf("%d", &n)) {
    memset(vis, 0, sizeof(vis));
    scanf("%d%d", &x, &y);
    for (int i = 0; i < n; i++) {
      scanf("%s%d%d", a[i].s, &a[i].x, &a[i].y);
      long long int tmp1 = a[i].x;
      tmp1 -= x;
      tmp1 *= tmp1;
      long long int tmp2 = a[i].y;
      tmp2 -= y;
      tmp2 *= tmp2;
      a[i].dis = tmp1 + tmp2;
    }
    int flag = 0;
    sort(a, a + n, cmp);
    for (int i = 0; i < n; i++) {
      if (a[i].x == x) {
        if (a[i].y > y) {
          if (vis[0] == 1) continue;
          vis[0] = 1;
          if (a[i].s[0] == 'R' || a[i].s[0] == 'Q') flag = 1;
        } else {
          if (vis[1] == 1) continue;
          vis[1] = 1;
          if (a[i].s[0] == 'R' || a[i].s[0] == 'Q') flag = 1;
        }
      }
      if (a[i].y == y) {
        if (a[i].x > x) {
          if (vis[2] == 1) continue;
          vis[2] = 1;
          if (a[i].s[0] == 'R' || a[i].s[0] == 'Q') flag = 1;
        } else {
          if (vis[3] == 1) continue;
          vis[3] = 1;
          if (a[i].s[0] == 'R' || a[i].s[0] == 'Q') flag = 1;
        }
      }
      if (abs(a[i].x - x) == abs(a[i].y - y)) {
        if (a[i].x > x && a[i].y > y) {
          if (vis[4] == 1) continue;
          vis[4] = 1;
          if (a[i].s[0] == 'Q' || a[i].s[0] == 'B') flag = 1;
        }
        if (a[i].x > x && a[i].y < y) {
          if (vis[5] == 1) continue;
          vis[5] = 1;
          if (a[i].s[0] == 'Q' || a[i].s[0] == 'B') flag = 1;
        }
        if (a[i].x < x && a[i].y > y) {
          if (vis[6] == 1) continue;
          vis[6] = 1;
          if (a[i].s[0] == 'Q' || a[i].s[0] == 'B') flag = 1;
        }
        if (a[i].x < x && a[i].y < y) {
          if (vis[7] == 1) continue;
          vis[7] = 1;
          if (a[i].s[0] == 'Q' || a[i].s[0] == 'B') flag = 1;
        }
      }
    }
    if (flag == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
