#include <bits/stdc++.h>
using namespace std;
const int inf = int(1e9) + 7;
const double eps = 0.0000000001, pi = 3.14159265358979323;
map<char, pair<pair<int, int>, char> > p;
inline int dist(int a, int b) { return abs(abs(a) - abs(b)); }
int main() {
  int n, X, Y;
  char q[] = {'u', 'd', 'r', 'l'}, w[] = {'m', 'k', 'n', 'z'};
  p['u'] = p['r'] = p['k'] = p['m'] = {{inf, inf}, 's'};
  p['d'] = p['l'] = p['n'] = p['z'] = {{-inf, -inf}, 's'};
  cin >> n >> X >> Y;
  for (int i = 1; i <= n; ++i) {
    char ch;
    int x, y;
    cin >> ch >> x >> y;
    if (X == x) {
      if (Y < y && (p['u'].first.second > y)) p['u'] = {{x, y}, ch};
      if (Y > y && (p['d'].first.second < y)) p['d'] = {{x, y}, ch};
    }
    if (Y == y) {
      if (X < x && (p['r'].first.first > x)) p['r'] = {{x, y}, ch};
      if (X > x && (p['l'].first.first < x)) p['l'] = {{x, y}, ch};
    }
    if (dist(x, X) == dist(y, Y)) {
      if (X < x && Y < y && (p['m'].first.first > x)) p['m'] = {{x, y}, ch};
      if (X < x && Y > y && (p['k'].first.first > x)) p['k'] = {{x, y}, ch};
      if (X > x && Y < y && (p['n'].first.first < x)) p['n'] = {{x, y}, ch};
      if (X > x && Y > y && (p['z'].first.first < x)) p['z'] = {{x, y}, ch};
    }
  }
  for (int i = 0; i < 4; ++i) {
    if (p[q[i]].second == 'R' || p[q[i]].second == 'Q') {
      cout << "YES";
      return 0;
    }
    if (p[w[i]].second == 'B' || p[w[i]].second == 'Q') {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
