#include <bits/stdc++.h>
std::pair<char, long long int>
    top = std::pair<char, long long int>('k', 100000000000),
    bot = std::pair<char, long long int>('k', 100000000000),
    right = std::pair<char, long long int>('k', 100000000000),
    left = std::pair<char, long long int>('k', 100000000000),
    topright = std::pair<char, long long int>('k', 100000000000),
    topleft = std::pair<char, long long int>('k', 100000000000),
    botleft = std::pair<char, long long int>('k', 100000000000),
    botright = std::pair<char, long long int>('k', 100000000000);
int main() {
  long int n;
  char c;
  long long int kx, ky;
  std::cin >> n >> kx >> ky;
  c = getchar();
  bool isCheck = false;
  while (n--) {
    long long int x, y;
    c = getchar();
    std::cin >> x >> y;
    long long int dis = std::abs(kx - x) + std::abs(ky - y);
    if (x == kx) {
      if (y - ky > 0) {
        if (dis < right.second) right = std::pair<char, long long int>(c, dis);
      } else {
        if (dis < left.second) left = std::pair<char, long long int>(c, dis);
      }
    } else if (y == ky) {
      if (x - kx > 0) {
        if (dis < bot.second) bot = std::pair<char, long long int>(c, dis);
      } else {
        if (dis < top.second) top = std::pair<char, long long int>(c, dis);
      }
    } else if (kx - x == ky - y) {
      if (x - kx > 0) {
        if (dis < botright.second)
          botright = std::pair<char, long long int>(c, dis);
      } else {
        if (dis < topleft.second)
          topleft = std::pair<char, long long int>(c, dis);
      }
    } else if (kx - x == y - ky) {
      if (x - kx > 0) {
        if (dis < botleft.second)
          botleft = std::pair<char, long long int>(c, dis);
      } else {
        if (dis < topright.second)
          topright = std::pair<char, long long int>(c, dis);
      }
    }
    c = getchar();
  }
  isCheck = (top.first == 'Q' || top.first == 'R') ? true : false;
  isCheck = (bot.first == 'Q' || bot.first == 'R' || isCheck) ? true : false;
  isCheck =
      (right.first == 'Q' || right.first == 'R' || isCheck) ? true : false;
  isCheck = (left.first == 'Q' || left.first == 'R' || isCheck) ? true : false;
  isCheck =
      (botleft.first == 'Q' || botleft.first == 'B' || isCheck) ? true : false;
  isCheck = (botright.first == 'Q' || botright.first == 'B' || isCheck) ? true
                                                                        : false;
  isCheck = (topright.first == 'Q' || topright.first == 'B' || isCheck) ? true
                                                                        : false;
  isCheck =
      (topleft.first == 'Q' || topleft.first == 'B' || isCheck) ? true : false;
  if (isCheck)
    printf("YES\n");
  else
    printf("NO\n");
}
