#include <bits/stdc++.h>
using namespace std;
bool esRoT(char c) { return c == 'R' or c == 'Q'; }
bool esRoA(char c) { return c == 'Q' or c == 'B'; }
bool miroLosDos(set<pair<int, char>>::iterator& l, set<pair<int, char>>& f) {
  bool resp = false;
  if (l != f.end()) {
    resp |= esRoT(l->second);
  }
  if (l != f.begin()) {
    l--;
    resp |= esRoT(l->second);
  }
  return resp;
}
bool miroLosDosD(set<pair<int, char>>::iterator& l, set<pair<int, char>>& f) {
  bool resp = false;
  if (l != f.end()) {
    resp |= esRoA(l->second);
  }
  if (l != f.begin()) {
    l--;
    resp |= esRoA(l->second);
  }
  return resp;
}
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int b, x, y, xx, yy;
  char t;
  cin >> b;
  cin >> xx >> yy;
  set<pair<int, char>> f, c, di, dd;
  bool resp = false;
  for (int i = 0; i < b; i++) {
    cin >> t >> x >> y;
    if (x == xx) f.insert({y, t});
    if (y == yy) c.insert({x, t});
    if (x - y == xx - yy) {
      dd.insert({x, t});
    }
    if (x + y == xx + yy) {
      di.insert({x, t});
    }
  }
  auto l = f.lower_bound({yy, t});
  resp |= miroLosDos(l, f);
  l = c.lower_bound({xx, t});
  resp |= miroLosDos(l, c);
  l = dd.lower_bound({xx, t});
  resp |= miroLosDosD(l, dd);
  l = di.lower_bound({xx, t});
  resp |= miroLosDosD(l, di);
  cout << (resp == true ? "YES" : "NO");
  return 0;
}
