#include <bits/stdc++.h>
using namespace std;
vector<pair<char, pair<int, int> > > closest(10,
                                             make_pair('*', make_pair(0, 0)));
int n, X, Y;
int check_dir(int x, int y) {
  if (x == X && y > Y) return 1;
  if (x == X && y < Y) return 5;
  if (Y == y && x > X) return 3;
  if (Y == y && x < X) return 7;
  if (X < x && (x - X) == (y - Y)) return 2;
  if (X > x && (x - X) == (y - Y)) return 6;
  if (y > Y && (X - x) == (y - Y)) return 4;
  if (y < Y && (X - x) == (y - Y)) return 8;
  return 0;
}
int dist(int x, int y, int xx, int yy) { return max(abs(xx - x), abs(yy - y)); }
void get_closest(char z, int x, int y, int dir) {
  if (closest[dir].first == '*' ||
      dist(X, Y, x, y) <
          dist(X, Y, closest[dir].second.first, closest[dir].second.second)) {
    closest[dir].first = z;
    closest[dir].second = make_pair(x, y);
  }
}
int main() {
  scanf("%d%d%d", &n, &X, &Y);
  for (int i = 0; i < n; ++i) {
    char z;
    int x, y;
    cin >> z >> x >> y;
    int dir = check_dir(x, y);
    if (dir) {
      get_closest(z, x, y, dir);
    }
  }
  bool flag = false;
  for (int i = 1; i <= 7; i += 2) {
    if (closest[i].first == 'R' || closest[i].first == 'Q') flag = true;
  }
  for (int i = 2; i <= 8; i += 2) {
    if (closest[i].first == 'B' || closest[i].first == 'Q') flag = true;
  }
  if (flag)
    printf("YES");
  else
    printf("NO");
  return 0;
}
