#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
pair<int, char> h1, h2;
pair<int, char> v1, v2;
pair<int, char> d1a, d1b;
pair<int, char> d2a, d2b;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  int x, y, tx, ty;
  pair<int, char> h1 = {2000000001, 'n'}, h2 = {-2000000001, 'n'};
  pair<int, char> v1 = {2000000001, 'n'}, v2 = {-2000000001, 'n'};
  pair<int, char> d1a = {2000000001, 'n'}, d1b = {-2000000001, 'n'};
  pair<int, char> d2a = {2000000001, 'n'}, d2b = {-2000000001, 'n'};
  char c;
  int a, b;
  cin >> n;
  cin >> x >> y;
  a = x - y;
  b = x + y;
  for (int i = 0; i < n; i++) {
    cin >> c >> tx >> ty;
    if (tx == x) {
      if (ty > y) {
        if (ty < v1.first) {
          v1.first = ty;
          v1.second = c;
        }
      } else {
        if (ty > v2.first) {
          v2.first = ty;
          v2.second = c;
        }
      }
    } else if (ty == y) {
      if (tx > x) {
        if (tx < h1.first) {
          h1.first = tx;
          h1.second = c;
        }
      } else {
        if (tx > h2.first) {
          h2.first = tx;
          h2.second = c;
        }
      }
    } else if (a == tx - ty) {
      if (tx > x) {
        if (tx < d1a.first) {
          d1a.first = tx;
          d1a.second = c;
        }
      } else {
        if (tx > d1b.first) {
          d1b.first = tx;
          d1b.second = c;
        }
      }
    } else if (b == tx + ty) {
      if (tx > x) {
        if (tx < d2a.first) {
          d2a.first = tx;
          d2a.second = c;
        }
      } else {
        if (tx > d2b.first) {
          d2b.first = tx;
          d2b.second = c;
        }
      }
    }
  }
  if ((d1b.second == 'Q') || (d1b.second == 'B') || (d1a.second == 'Q') ||
      (d1a.second == 'B') || (d2a.second == 'Q') || (d2a.second == 'B') ||
      (d2b.second == 'Q') || (d2b.second == 'B')) {
    cout << "YES";
  } else if ((h1.second == 'Q') || (h1.second == 'R') || (h2.second == 'Q') ||
             (h2.second == 'R') || (v1.second == 'Q') || (v1.second == 'R') ||
             (v2.second == 'Q') || (v2.second == 'R')) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
