#include <bits/stdc++.h>
using namespace std;
pair<char, pair<long long, long long> > p[8];
long long i, n, x, y, a, b;
char ch;
long long get_direction() {
  if ((b == y) && a > x) return 0;
  if ((b == y) && a < x) return 1;
  if ((a == x) && b > y) return 2;
  if ((a == x) && b < y) return 3;
  if (((a - x) == (b - y)) && a > x) return 4;
  if (((a - x) == (b - y)) && a < x) return 5;
  if (((a - x) == -1 * (b - y)) && b > y) return 6;
  if (((a - x) == -1 * (b - y)) && b < y) return 7;
  return -1;
}
int main() {
  long long pos, j;
  cin >> n >> x >> y;
  for (i = 0; i < 8; i++) {
    p[i].first = '?';
  }
  for (j = 0; j < n; j++) {
    cin >> ch >> a >> b;
    i = get_direction();
    if (i != -1) {
      if (p[i].first == '?') {
        p[i].second.first = a;
        p[i].second.second = b;
        p[i].first = ch;
      } else {
        if (max(abs(p[i].second.first - x), abs(p[i].second.second - y)) >
            max(abs(a - x), abs(b - y))) {
          p[i].second.first = a;
          p[i].second.second = b;
          p[i].first = ch;
        }
      }
    }
  }
  long long flag = 0;
  for (i = 0; i < 4; i++) {
    if (p[i].first == 'Q' || p[i].first == 'R') flag = 1;
  }
  for (i = 4; i < 8; i++) {
    if (p[i].first == 'Q' || p[i].first == 'B') flag = 1;
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
}
