#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9 + 9;
int A[8], B[8];
int main() {
  fill(A, A + 8, (int)2e9 + 9);
  fill(B, B + 8, (int)2e9 + 9);
  int n;
  cin >> n;
  int kx, ky;
  cin >> kx >> ky;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    int x, y;
    cin >> x >> y;
    int a = x - kx, b = y - ky;
    if (abs(a) == abs(b)) {
      int* p = (c == 'B' || c == 'Q') ? A : B;
      if (a > 0 && b > 0) p[0] = min(p[0], abs(a));
      if (a < 0 && b > 0) p[1] = min(p[1], abs(a));
      if (a < 0 && b < 0) p[2] = min(p[2], abs(a));
      if (a > 0 && b < 0) p[3] = min(p[3], abs(a));
    } else if (a == 0) {
      int* p = (c == 'R' || c == 'Q') ? A : B;
      if (b > 0) p[4] = min(p[4], b);
      if (b < 0) p[5] = min(p[5], -b);
    } else if (b == 0) {
      int* p = (c == 'R' || c == 'Q') ? A : B;
      if (a > 0) p[6] = min(p[6], a);
      if (a < 0) p[7] = min(p[7], -a);
    }
  }
  bool flag = false;
  for (int i = 0; i < 8; i++)
    if (A[i] < B[i]) flag = true;
  flag ? printf("YES\n") : printf("NO\n");
  return 0;
}
