#include <bits/stdc++.h>
using namespace std;
vector<long long> row;
vector<long long> col;
vector<long long> d1;
vector<long long> d2;
vector<pair<long long, long long>> r;
vector<pair<long long, long long>> b;
signed main() {
  long long n, x0, y0;
  scanf("%lld", &n);
  scanf("%lld", &x0);
  scanf("%lld", &y0);
  col.push_back(x0);
  row.push_back(y0);
  d1.push_back(x0);
  d2.push_back(x0);
  while (n--) {
    char ch;
    long long x1, y1;
    scanf(" %c%lld%lld", &ch, &x1, &y1);
    if (ch == 'Q') {
      r.push_back({x1, y1});
      b.push_back({x1, y1});
    } else if (ch == 'R') {
      r.push_back({x1, y1});
    }
    if (ch == 'B') {
      b.push_back({x1, y1});
    }
    if (x0 == x1) {
      row.push_back(y1);
    }
    if (y0 == y1) {
      col.push_back(x1);
    }
    if ((x0 + y0) == (x1 + y1)) {
      d1.push_back(x1);
    }
    if ((x0 - y0) == (x1 - y1)) {
      d2.push_back(x1);
    }
  }
  sort(row.begin(), row.end());
  sort(col.begin(), col.end());
  sort(d1.begin(), d1.end());
  sort(d2.begin(), d2.end());
  for (auto& rook : r) {
    if (rook.second == y0) {
      auto it = lower_bound(col.begin(), col.end(), rook.first);
      auto it1 = lower_bound(col.begin(), col.end(), x0);
      if (abs(distance(it, it1)) == 1) {
        cout << "YES";
        return 0;
      }
    }
    if (rook.first == x0) {
      auto it = lower_bound(row.begin(), row.end(), rook.second);
      auto it1 = lower_bound(row.begin(), row.end(), y0);
      if (abs(distance(it, it1)) == 1) {
        cout << "YES";
        return 0;
      }
    }
  }
  for (auto& bishop : b) {
    if ((bishop.first + bishop.second) == (x0 + y0)) {
      auto it = lower_bound(d1.begin(), d1.end(), bishop.first);
      auto it1 = lower_bound(d1.begin(), d1.end(), x0);
      if (abs(distance(it, it1)) == 1) {
        cout << "YES";
        return 0;
      }
    }
    if ((bishop.first - bishop.second) == (x0 - y0)) {
      auto it = lower_bound(d2.begin(), d2.end(), bishop.first);
      auto it1 = lower_bound(d2.begin(), d2.end(), x0);
      if (abs(distance(it, it1)) == 1) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
