#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long r, c;
  cin >> r >> c;
  vector<pair<long long, char> > v1;
  vector<pair<long long, char> > v2;
  vector<pair<long long, char> > v3;
  vector<pair<long long, char> > v4;
  vector<pair<long long, char> > v5;
  vector<pair<long long, char> > v6;
  vector<pair<long long, char> > v7;
  vector<pair<long long, char> > v8;
  for (int i = 0; i < n; i++) {
    char ch;
    long long x, y;
    cin >> ch >> x >> y;
    int xx = abs(x - r);
    int yy = abs(y - c);
    if (r == x) {
      if (c > y) {
        v1.push_back({abs(c - y), ch});
      } else {
        v2.push_back({abs(c - y), ch});
      }
    }
    if (c == y) {
      if (x > r) {
        v3.push_back({abs(r - x), ch});
      } else {
        v4.push_back({abs(r - x), ch});
      }
    }
    if (xx == yy) {
      if (x < r && y > c) {
        v5.push_back({xx, ch});
      }
      if (x > r && y > c) {
        v6.push_back({xx, ch});
      }
      if (x > r && y < c) {
        v7.push_back({xx, ch});
      }
      if (x < r && y < c) {
        v8.push_back({xx, ch});
      }
    }
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  sort(v3.begin(), v3.end());
  sort(v4.begin(), v4.end());
  sort(v5.begin(), v5.end());
  sort(v6.begin(), v6.end());
  sort(v7.begin(), v7.end());
  sort(v8.begin(), v8.end());
  bool flag = 0;
  if (v1.size() && (v1[0].second == 'Q' || v1[0].second == 'R')) {
    flag = 1;
  }
  if (v2.size() && (v2[0].second == 'Q' || v2[0].second == 'R')) {
    flag = 1;
  }
  if (v3.size() && (v3[0].second == 'Q' || v3[0].second == 'R')) {
    flag = 1;
  }
  if (v4.size() && (v4[0].second == 'Q' || v4[0].second == 'R')) {
    flag = 1;
  }
  if (v5.size() && (v5[0].second == 'Q' || v5[0].second == 'B')) {
    flag = 1;
  }
  if (v6.size() && (v6[0].second == 'Q' || v6[0].second == 'B')) {
    flag = 1;
  }
  if (v7.size() && (v7[0].second == 'Q' || v7[0].second == 'B')) {
    flag = 1;
  }
  if (v8.size() && (v8[0].second == 'Q' || v8[0].second == 'B')) {
    flag = 1;
  }
  if (flag) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
}
