#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
using namespace std;
char t[MAXN];
long long x[MAXN], y[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  srand(time(0));
  long long n, i, kx, ky;
  long long y1 = -MAXLL, x2 = MAXLL, x3 = MAXLL, x4 = MAXLL, y5 = MAXLL,
            y6 = MAXLL, x7 = -MAXLL, x8 = -MAXLL;
  char t1 = 'B', t2 = 'R', t3 = 'B', t4 = 'R', t5 = 'B', t6 = 'R', t7 = 'B',
       t8 = 'R';
  cin >> n;
  cin >> kx >> ky;
  for (i = 1; i <= n; i++) {
    cin >> t[i] >> x[i] >> y[i];
    if (x[i] == kx && y[i] < ky && y[i] > y1) y1 = y[i], t1 = t[i];
    if (ky > y[i] && kx < x[i] && ky - y[i] == x[i] - kx && x[i] < x2)
      x2 = x[i], t2 = t[i];
    if (y[i] == ky && x[i] > kx && x[i] < x3) x3 = x[i], t3 = t[i];
    if (x[i] > kx && y[i] > ky && x[i] - kx == y[i] - ky && x[i] < x4)
      x4 = x[i], t4 = t[i];
    if (x[i] == kx && y[i] > ky && y[i] < y5) y5 = y[i], t5 = t[i];
    if (kx > x[i] && ky < y[i] && y[i] - ky == kx - x[i] && y[i] < y6)
      y6 = y[i], t6 = t[i];
    if (y[i] == ky && x[i] < kx && x[i] > x7) x7 = x[i], t7 = t[i];
    if (x[i] < kx && y[i] < ky && ky - y[i] == kx - x[i] && x[i] > x8)
      x8 = x[i], t8 = t[i];
  }
  if (t1 != 'B' || t2 != 'R' || t3 != 'B' || t4 != 'R' || t5 != 'B' ||
      t6 != 'R' || t7 != 'B' || t8 != 'R')
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
