#include <bits/stdc++.h>
using namespace std;
const int oo = 2e9 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N;
  cin >> N;
  int PX, PY;
  cin >> PX >> PY;
  pair<long long, char> U = pair<long long, char>(oo, ' ');
  pair<long long, char> D = pair<long long, char>(oo, ' ');
  pair<long long, char> R = pair<long long, char>(oo, ' ');
  pair<long long, char> L = pair<long long, char>(oo, ' ');
  pair<long long, char> LUD = pair<long long, char>(oo, ' ');
  pair<long long, char> RUD = pair<long long, char>(oo, ' ');
  pair<long long, char> LDD = pair<long long, char>(oo, ' ');
  pair<long long, char> RDD = pair<long long, char>(oo, ' ');
  for (int i = 1; i <= N; i++) {
    char c[2];
    int a, b;
    cin >> c >> a >> b;
    if (a == PX && b < PY && PY - b < U.first)
      U.first = PY - b, U.second = c[0];
    if (a == PX && b > PY && b - PY < D.first)
      D.first = b - PY, D.second = c[0];
    if (b == PY && a < PX && PX - a < L.first)
      L.first = PX - a, L.second = c[0];
    if (b == PY && a > PX && a - PX < R.first)
      R.first = a - PX, R.second = c[0];
    if (b < PY && a < PX && abs(b - PY) == abs(a - PX) &&
        abs(b - PY) < LUD.first)
      LUD.first = abs(b - PY), LUD.second = c[0];
    if (b < PY && a > PX && abs(b - PY) == abs(a - PX) &&
        abs(b - PY) < RUD.first)
      RUD.first = abs(b - PY), RUD.second = c[0];
    if (b > PY && a < PX && abs(b - PY) == abs(a - PX) &&
        abs(b - PY) < LDD.first)
      LDD.first = abs(b - PY), LDD.second = c[0];
    if (b > PY && a > PX && abs(b - PY) == abs(a - PX) &&
        abs(b - PY) < RDD.first)
      RDD.first = abs(b - PY), RDD.second = c[0];
  }
  bool band = 0;
  if (U.second == 'R' || U.second == 'Q') band = 1;
  if (D.second == 'R' || D.second == 'Q') band = 1;
  if (R.second == 'R' || R.second == 'Q') band = 1;
  if (L.second == 'R' || L.second == 'Q') band = 1;
  if (LUD.second == 'B' || LUD.second == 'Q') band = 1;
  if (RUD.second == 'B' || RUD.second == 'Q') band = 1;
  if (LDD.second == 'B' || LDD.second == 'Q') band = 1;
  if (RDD.second == 'B' || RDD.second == 'Q') band = 1;
  if (band)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
