#include <bits/stdc++.h>
using namespace std;
int dist(int x0, int y0, int x, int y) {
  if (abs(x - x0) == abs(y - y0)) {
    return abs(x - x0);
  } else {
    if (x == x0)
      return abs(y - y0);
    else
      return abs(x - x0);
  }
}
int direction(int x0, int y0, int x, int y) {
  if (x == x0) {
    if (y > y0) {
      return 3;
    } else {
      return 7;
    }
  } else if (y == y0) {
    if (x0 > x) {
      return 1;
    } else {
      return 5;
    }
  } else if (x < x0 && y > y0) {
    return 2;
  } else if (x > x0 && y > y0) {
    return 4;
  } else if (x > x0 && y < y0) {
    return 6;
  } else {
    return 8;
  }
}
vector<pair<char, pair<int, int> > > pos;
pair<char, int> closest[10];
int main() {
  int n, x0, y0, x, y;
  char pl;
  cin >> n >> x0 >> y0;
  for (int i = 0; i < n; i++) {
    cin >> pl >> x >> y;
    if (abs(x - x0) == abs(y - y0) || y == y0 || x == x0) {
      pos.push_back(make_pair(pl, make_pair(x, y)));
    }
  }
  for (int i = 0; i < 10; i++) {
    closest[i].second = 2147483647;
    closest[i].first = 'a';
  }
  for (int i = 0; i < pos.size(); i++) {
    int dir = direction(x0, y0, pos[i].second.first, pos[i].second.second);
    if (closest[dir].second >
        dist(x0, y0, pos[i].second.first, pos[i].second.second)) {
      closest[dir].first = pos[i].first;
      closest[dir].second =
          dist(x0, y0, pos[i].second.first, pos[i].second.second);
    }
  }
  bool check = false;
  for (int i = 1; i <= 8; i++) {
    pl = closest[i].first;
    if (pl != 'a') {
      if (pl == 'Q') {
        check = true;
      } else if (pl == 'R' && i & 1) {
        check = true;
      } else if (pl == 'B' && i % 2 == 0) {
        check = true;
      }
    }
  }
  if (check) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
