#include <bits/stdc++.h>
using namespace std;
long long int min(long long int a, long long int b) {
  if (a < b) return a;
  return b;
}
long long int max(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
int main() {
  long long int n, x0, y0, x, y, key, xr, xl, yu, yd, df1x, df1y, df2x, df2y,
      db1x, db1y, db2x, db2y, xrp = 5, xlp = 5, yup = 5, ydp = 5, df1p = 5,
                              db1p = 5, df2p = 5, db2p = 5;
  char p;
  scanf("%lld", &n);
  scanf("%lld %lld", &x0, &y0);
  for (int i = 0; i < (n); ++i) {
    cin >> p;
    scanf("%lld %lld", &x, &y);
    if (p == 'B')
      key = 1;
    else if (p == 'Q')
      key = 2;
    else
      key = 3;
    if (x0 == x && y > y0 && (yup == 5 || (y < yu))) {
      yu = y;
      yup = key;
    } else if (x0 == x && y < y0 && (ydp == 5 || (y > yd))) {
      yd = y;
      ydp = key;
    } else if (y0 == y && x > x0 && (xrp == 5 || (x < xr))) {
      xr = x;
      xrp = key;
    } else if (y0 == y && x < x0 && (xlp == 5 || (x > xl))) {
      xl = x;
      xlp = key;
    } else if ((y > y0 && x > x0) && (y - y0 == x - x0) &&
               ((df1p == 5) || (df1x > x && df1y > y))) {
      df1x = x;
      df1y = y;
      df1p = key;
    } else if ((y > y0 && x < x0) && (y0 - y == x - x0) &&
               ((df2p == 5) || (df2x < x && df2y > y))) {
      df2x = x;
      df2y = y;
      df2p = key;
    } else if ((y < y0 && x > x0) && (y0 - y == x - x0) &&
               ((db1p == 5) || (db1x > x && db1y < y))) {
      db1x = x;
      db1y = y;
      db1p = key;
    } else if ((y < y0 && x < x0) && (y - y0 == x - x0) &&
               ((db2p == 5) || (db2x < x && db2y < y))) {
      db2x = x;
      db2y = y;
      db2p = key;
    }
  }
  if (xrp != 5 && (xrp == 2 || xrp == 3))
    cout << "YES";
  else if (xlp != 5 && (xlp == 2 || xlp == 3))
    cout << "YES";
  else if (yup != 5 && (yup == 2 || yup == 3))
    cout << "YES";
  else if (ydp != 5 && (ydp == 2 || ydp == 3))
    cout << "YES";
  else if (df1p != 5 && (df1p == 1 || df1p == 2))
    cout << "YES";
  else if (df2p != 5 && (df2p == 1 || df2p == 2))
    cout << "YES";
  else if (db1p != 5 && (db1p == 1 || db1p == 2))
    cout << "YES";
  else if (db2p != 5 && (db2p == 1 || db2p == 2))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
