#include <bits/stdc++.h>
using namespace std;
const long long mxn = 5 * 1e5 + 1;
const long long INF = 1e18 + 1;
struct black {
  char t;
  long long vx, vy;
};
black g;
long long huong(long long x, long long y, long long x0, long long y0) {
  if (x == x0 && y < y0) return 1;
  if (x == x0 && y > y0) return 2;
  if (x < x0 && y == y0) return 3;
  if (x > x0 && y == y0) return 4;
  if (x - x0 == y - y0 && x < x0) return 5;
  if (x - x0 == y - y0 && x > x0) return 6;
  if (x - x0 == y0 - y && y < y0) return 7;
  if (x - x0 == y0 - y && y > y0) return 8;
  return 0;
}
black gannhat[9];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (long long i = 0; i < 9; i++) {
    gannhat[i].vx = INF;
    gannhat[i].vy = INF;
  }
  long long n, x0, y0;
  cin >> n;
  cin >> x0 >> y0;
  for (long long i = 0; i < n; i++) {
    cin >> g.t >> g.vx >> g.vy;
    long long hg = huong(g.vx, g.vy, x0, y0);
    if (hg > 0) {
      long long tmp = max(abs(x0 - g.vx), abs(y0 - g.vy));
      long long now = max(abs(x0 - gannhat[hg].vx), abs(y0 - gannhat[hg].vy));
      if (tmp < now) {
        gannhat[hg] = g;
      }
    }
  }
  for (long long i = 1; i <= 4; i++)
    if (gannhat[i].vx != INF) {
      if (gannhat[i].t == 'R' || gannhat[i].t == 'Q') {
        cout << "YES";
        return 0;
      }
    }
  for (long long i = 5; i < 9; i++)
    if (gannhat[i].vx != INF) {
      if (gannhat[i].t == 'B' || gannhat[i].t == 'Q') {
        cout << "YES";
        return 0;
      }
    }
  cout << "NO";
}
