#include <bits/stdc++.h>
using namespace std;
long long lim = 1LL << 40;
struct node {
  long long x;
  long long y;
  char c;
  node() { c = 'Z'; }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  node up;
  up.y = lim;
  node down;
  down.y = -lim;
  node right;
  right.x = lim;
  node left;
  left.x = -lim;
  node corner1;
  corner1.x = lim;
  corner1.y = lim;
  node corner2;
  corner2.x = -lim;
  corner2.y = lim;
  node corner3;
  corner3.x = -lim;
  corner3.y = -lim;
  node corner4;
  corner4.x = lim;
  corner4.y = -lim;
  int n;
  cin >> n;
  long long x0, y0;
  cin >> x0 >> y0;
  long long a, b;
  char ch;
  for (int i = 0; i < n; i++) {
    cin >> ch >> a >> b;
    if (a == x0) {
      if (b > y0 && b < up.y) {
        up.y = b;
        up.c = ch;
      } else if (b < y0 && b > down.y) {
        down.y = b;
        down.c = ch;
      }
    }
    if (b == y0) {
      if (a > x0 && a < right.x) {
        right.x = a;
        right.c = ch;
      } else if (a < x0 && a > left.x) {
        left.x = a;
        left.c = ch;
      }
    }
    if (fabs(x0 - a) == fabs(y0 - b)) {
      if (a > x0 && b > y0) {
        if (a < corner1.x && b < corner1.y) {
          corner1.x = a;
          corner1.y = b;
          corner1.c = ch;
        }
      } else if (a < x0 && b > y0) {
        if (a > corner2.x && b < corner2.y) {
          corner2.x = a;
          corner2.y = b;
          corner2.c = ch;
        }
      } else if (a < x0 && b < y0) {
        if (a > corner3.x && b > corner3.y) {
          corner3.x = a;
          corner3.y = b;
          corner3.c = ch;
        }
      } else if (a > x0 && b < y0) {
        if (a < corner4.x && b > corner4.y) {
          corner4.x = a;
          corner4.y = b;
          corner4.c = ch;
        }
      }
    }
  }
  bool flag = false;
  if (up.c == 'R' || up.c == 'Q') flag = true;
  if (down.c == 'R' || down.c == 'Q') flag = true;
  if (right.c == 'R' || right.c == 'Q') flag = true;
  if (left.c == 'R' || left.c == 'Q') flag = true;
  if (corner1.c == 'Q' || corner1.c == 'B') flag = true;
  if (corner2.c == 'Q' || corner2.c == 'B') flag = true;
  if (corner3.c == 'Q' || corner3.c == 'B') flag = true;
  if (corner4.c == 'Q' || corner4.c == 'B') flag = true;
  if (flag)
    cout << "YES";
  else
    cout << "NO";
}
