#include <bits/stdc++.h>
using namespace std;
bool comparaH(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
bool comparaV(pair<int, int> a, pair<int, int> b) {
  return a.second < b.second;
}
bool comparaD1(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
bool comparaD2(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int main() {
  int n;
  int x, y;
  scanf("%d", &n);
  scanf("%d %d", &x, &y);
  vector<pair<int, int> > h;
  vector<pair<int, int> > v;
  vector<pair<int, int> > d1;
  vector<pair<int, int> > d2;
  vector<pair<int, int> > obsh;
  vector<pair<int, int> > obsv;
  vector<pair<int, int> > obsd1;
  vector<pair<int, int> > obsd2;
  while (n--) {
    string tipo;
    int a, b;
    cin >> tipo >> a >> b;
    if (tipo[0] == 'R') {
      if (b == y) h.push_back(make_pair(a, b));
      if (a == x) v.push_back(make_pair(a, b));
    } else if (tipo[0] == 'B') {
      if (a + b == x + y) d1.push_back(make_pair(a, b));
      if (b - a == y - x) d2.push_back(make_pair(a, b));
    } else {
      if (b == y) h.push_back(make_pair(a, b));
      if (a == x) v.push_back(make_pair(a, b));
      if (a + b == x + y) d1.push_back(make_pair(a, b));
      if (b - a == y - x) d2.push_back(make_pair(a, b));
    }
    if (b == y) obsh.push_back(make_pair(a, b));
    if (a == x) obsv.push_back(make_pair(a, b));
    if (a + b == x + y) obsd1.push_back(make_pair(a, b));
    if (b - a == y - x) obsd2.push_back(make_pair(a, b));
  }
  sort(obsh.begin(), obsh.end(), comparaH);
  sort(obsv.begin(), obsv.end(), comparaV);
  sort(obsd1.begin(), obsd1.end(), comparaD1);
  sort(obsd2.begin(), obsd2.end(), comparaD2);
  bool ok = false;
  for (int i = 0; i < max(max(max(h.size(), v.size()), d1.size()), d2.size());
       i++) {
    if (ok) break;
    int pos;
    if (i < h.size()) {
      if (h[i].first < x) {
        pos = lower_bound(obsh.begin(), obsh.end(),
                          make_pair(h[i].first + 1, y), comparaH) -
              obsh.begin();
        if (pos >= obsh.size() || obsh[pos].first > x) ok = true;
      } else {
        pos = lower_bound(obsh.begin(), obsh.end(), make_pair(x + 1, y),
                          comparaH) -
              obsh.begin();
        if (pos >= obsh.size() || obsh[pos].first >= h[i].first) ok = true;
      }
    }
    if (i < v.size()) {
      if (v[i].second < y) {
        pos = lower_bound(obsv.begin(), obsv.end(),
                          make_pair(x, v[i].second + 1), comparaV) -
              obsv.begin();
        if (pos >= obsv.size() || obsv[pos].second > y) ok = true;
      } else {
        pos = lower_bound(obsv.begin(), obsv.end(), make_pair(x, y + 1),
                          comparaV) -
              obsv.begin();
        if (pos >= obsv.size() || obsv[pos].second >= v[i].second) ok = true;
      }
    }
    if (i < d1.size()) {
      if (d1[i].first < x) {
        pos = lower_bound(obsd1.begin(), obsd1.end(),
                          make_pair(d1[i].first + 1, y), comparaD1) -
              obsd1.begin();
        if (pos >= obsd1.size() || obsd1[pos].first > x) ok = true;
      } else {
        pos = lower_bound(obsd1.begin(), obsd1.end(), make_pair(x + 1, y),
                          comparaD1) -
              obsd1.begin();
        if (pos >= obsd1.size() || obsd1[pos].first >= d1[i].first) ok = true;
      }
    }
    if (i < d2.size()) {
      if (d2[i].first < x) {
        pos = lower_bound(obsd2.begin(), obsd2.end(),
                          make_pair(d2[i].first + 1, y), comparaD2) -
              obsd2.begin();
        if (pos >= obsd2.size() || obsd2[pos].first > x) ok = true;
      } else {
        pos = lower_bound(obsd2.begin(), obsd2.end(), make_pair(x + 1, y),
                          comparaD2) -
              obsd2.begin();
        if (pos >= obsd2.size() || obsd2[pos].first >= d2[i].first) ok = true;
      }
    }
  }
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
}
