#include <bits/stdc++.h>
using namespace std;
struct node {
  char s[10];
  int x, y;
} A[511111];
int main() {
  int n, x, y;
  scanf("%d", &n);
  scanf("%d%d", &x, &y);
  char s[10], xx, yy;
  int B[10];
  memset(B, -1, sizeof(B));
  for (int i = 0; i < n; i++) {
    scanf("%s%d%d", &A[i].s, &A[i].x, &A[i].y);
    int xx = A[i].x, yy = A[i].y;
    if (yy == y) {
      if (xx > x) {
        if (B[3] == -1)
          B[3] = i;
        else if (A[B[3]].x > xx)
          B[3] = i;
      } else {
        if (B[7] == -1)
          B[7] = i;
        else if (A[B[7]].x < xx)
          B[7] = i;
      }
    }
    if (xx == x) {
      if (yy > y) {
        if (B[1] == -1)
          B[1] = i;
        else if (A[B[1]].y > yy)
          B[1] = i;
      } else {
        if (B[5] == -1)
          B[5] = i;
        else if (A[B[5]].y < yy)
          B[5] = i;
      }
    }
    if (yy - xx == y - x) {
      if (xx > x) {
        if (B[2] == -1)
          B[2] = i;
        else if (A[B[2]].x > xx)
          B[2] = i;
      } else {
        if (B[6] == -1)
          B[6] = i;
        else if (A[B[6]].x < xx)
          B[6] = i;
      }
    }
    if (yy + xx == y + x) {
      if (xx > x) {
        if (B[4] == -1)
          B[4] = i;
        else if (A[B[4]].x > xx)
          B[4] = i;
      } else {
        if (B[8] == -1)
          B[8] = i;
        else if (A[B[8]].x < xx)
          B[8] = i;
      }
    }
  }
  int flag = 0;
  for (int i = 1; i < 9; i++) {
    if (B[i] != -1) {
      if (i % 4 == 1 || i % 4 == 3) {
        if (A[B[i]].s[0] == 'R' || A[B[i]].s[0] == 'Q') {
          flag = 1;
          break;
        }
      } else {
        if (A[B[i]].s[0] == 'B' || A[B[i]].s[0] == 'Q') {
          flag = 1;
          break;
        }
      }
    }
  }
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
}
