#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<long long int, char> > v1, v2, v3, v4, v5, v6, v7, v8;
  long long int n, x, y;
  cin >> n;
  cin >> x >> y;
  for (int i = 0; i < n; i++) {
    long long int x1, y1;
    char c;
    cin >> c >> x1 >> y1;
    if (x1 == x) {
      if (y1 < y) {
        v1.push_back(make_pair(y1, c));
      } else
        v2.push_back(make_pair(y1, c));
    } else if (y1 == y) {
      if (x1 < x) {
        v3.push_back(make_pair(x1, c));
      } else
        v4.push_back(make_pair(x1, c));
    } else if ((x - y) == (x1 - y1)) {
      if (x < x1) {
        v5.push_back(make_pair(x1, c));
      } else {
        v6.push_back(make_pair(x1, c));
      }
    } else if ((x + y) == (x1 + y1)) {
      if (x < x1) {
        v7.push_back(make_pair(x1, c));
      } else {
        v8.push_back(make_pair(x1, c));
      }
    }
  }
  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());
  if (v1.size() != 0 &&
      (v1[v1.size() - 1].second == 'R' || v1[v1.size() - 1].second == 'Q')) {
    cout << "YES";
    return 0;
  }
  if (v2.size() != 0 && (v2[0].second == 'R' || v2[0].second == 'Q')) {
    cout << "YES";
    return 0;
  }
  if (v3.size() != 0 &&
      (v3[v3.size() - 1].second == 'R' || v3[v3.size() - 1].second == 'Q')) {
    cout << "YES";
    return 0;
  }
  if (v4.size() != 0 && (v4[0].second == 'R' || v4[0].second == 'Q')) {
    cout << "YES";
    return 0;
  }
  if (v5.size() != 0 && (v5[0].second == 'B' || v5[0].second == 'Q')) {
    cout << "YES";
    return 0;
  }
  if (v6.size() != 0 &&
      (v6[v6.size() - 1].second == 'B' || v6[v6.size() - 1].second == 'Q')) {
    cout << "YES";
    return 0;
  }
  if (v7.size() != 0 && (v7[0].second == 'B' || v7[0].second == 'Q')) {
    cout << "YES";
    return 0;
  }
  if (v8.size() != 0 &&
      (v8[v8.size() - 1].second == 'B' || v8[v8.size() - 1].second == 'Q')) {
    cout << "YES";
    return 0;
  } else
    cout << "NO";
  return 0;
}
