#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 1, -1, 0, 1, -1, -1, 1};
const int dy[] = {-1, 0, 0, 1, 1, 1, -1, -1};
const long long int MOD = 0;
const long long int N = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n, x, y, xx, yy;
  char op;
  vector<pair<long long int, long long int> > r, q, b;
  vector<pair<char, pair<long long int, long long int> > > geral, aux(8);
  cin >> n;
  cin >> x >> y;
  for (int i = 0; i < 8; i++) {
    aux[i] = make_pair('X', make_pair(0, 0));
  }
  for (int i = 0; i < n; i++) {
    cin >> op >> xx >> yy;
    geral.push_back(make_pair(op, make_pair(xx, yy)));
  }
  bool achou;
  long long int menor0 = 1LL + 1e12;
  long long int menor1 = 1LL + 1e12;
  long long int menor2 = 1LL + 1e12;
  long long int menor3 = 1LL + 1e12;
  long long int menor4 = 1LL + 1e12;
  long long int menor5 = 1LL + 1e12;
  long long int menor6 = 1LL + 1e12;
  long long int menor7 = 1LL + 1e12;
  for (int i = 0; i < geral.size(); i++) {
    xx = geral[i].second.first;
    yy = geral[i].second.second;
    if (yy == y && xx < x) {
      if (x - xx < menor0) {
        menor0 = x - xx;
        aux[0] = geral[i];
      }
    }
    if (yy == y && xx > x) {
      if (xx - x < menor1) {
        menor1 = xx - x;
        aux[1] = geral[i];
      }
    }
    if (xx == x && yy > y) {
      if (abs(y - yy) < menor2) {
        menor2 = abs(y - yy);
        aux[2] = geral[i];
      }
    }
    if (xx == x && yy < y) {
      if (y - yy < menor3) {
        menor3 = y - yy;
        aux[3] = geral[i];
      }
    }
    if (xx < x && yy > y && x + y == xx + yy) {
      if (yy - y < menor4) {
        menor4 = yy - y;
        aux[4] = geral[i];
      }
    }
    if (xx > x && yy > y && x - y == xx - yy) {
      if (yy - y < menor5) {
        menor5 = yy - y;
        aux[5] = geral[i];
      }
    }
    if (xx < x && yy < y && x - y == xx - yy) {
      if (y - yy < menor6) {
        menor6 = y - yy;
        aux[6] = geral[i];
      }
    }
    if (xx > x && yy < y && x + y == xx + yy) {
      if (y - yy < menor7) {
        menor7 = y - yy;
        aux[7] = geral[i];
      }
    }
  }
  achou = false;
  for (int i = 0; i < 8; i++) {
    if (aux[i].first == 'B') {
      if (i >= 4) achou = true;
    } else if (aux[i].first == 'R') {
      if (i < 4) achou = true;
    } else if (aux[i].first == 'Q') {
      achou = true;
    }
  }
  if (achou)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
