#include <bits/stdc++.h>
using namespace std;
long long dis[3][3];
char c[3][3];
void init() {
  for (int i = (int)0; i < (int)3; ++i)
    for (int j = (int)0; j < (int)3; ++j) {
      c[i][j] = 'W';
      dis[i][j] = 0x3f3f3f3f3f3f3f;
    }
}
int n, x, y;
int f(long long w) {
  if (w < 0) return 0;
  if (w == 0) return 1;
  return 2;
}
pair<int, int> deal(int u, int v) {
  long long a = 1LL * x - u, b = 1LL * y - v;
  if (abs(a) == abs(b) || !a || !b) return {f(a), f(b)};
  return {3, 3};
}
long long ds(long long x, long long y) { return abs(x) + abs(y); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  init();
  cin >> n >> x >> y;
  int u, v;
  string s;
  for (int k = (int)0; k < (int)n; ++k) {
    cin >> s >> u >> v;
    pair<int, int> p = deal(u, v);
    if (p.first > 2) continue;
    long long z;
    if (dis[p.first][p.second] > (z = ds(1LL * x - u, 1LL * y - v)))
      dis[p.first][p.second] = z, c[p.first][p.second] = s[0];
  }
  bool flag = 0;
  for (int i = (int)0; i < (int)3; ++i)
    for (int j = (int)0; j < (int)3; ++j) {
      if ((i == 1 || j == 1) && (c[i][j] == 'R' || c[i][j] == 'Q')) flag = 1;
      if ((i != 1 && j != 1) && (c[i][j] == 'B' || c[i][j] == 'Q')) flag = 1;
    }
  puts((flag) ? "YES" : "NO");
  return 0;
}
