#include <bits/stdc++.h>
using namespace std;
int SET(int n, int pos) { return n = n | (1 << pos); }
int RESET(int n, int pos) { return n = n & ~(1 << pos); }
int CHECK(int n, int pos) { return (bool)(n & (1 << pos)); }
int str2int(string s) {
  stringstream ss(s);
  int x;
  ss >> x;
  return x;
}
string int2str(int a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
string char2str(char a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
long long int bigMod(long long int n, long long int power, long long int MOD) {
  if (power == 0) return 1;
  if (power % 2 == 0) {
    long long int ret = bigMod(n, power / 2, MOD);
    return ((ret % MOD) * (ret % MOD)) % MOD;
  } else
    return ((n % MOD) * (bigMod(n, power - 1, MOD) % MOD)) % MOD;
}
long long int modInverse(long long int n, long long int MOD) {
  return bigMod(n, MOD - 2, MOD);
}
int POW(int x, int y) {
  int res = 1;
  for (; y;) {
    if ((y & 1)) {
      res *= x;
    }
    x *= x;
    y >>= 1;
  }
  return res;
}
int inverse(int x) {
  double p = ((double)1.0) / x;
  return (p) + 1e-9;
}
int gcd(int a, int b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
int nC2(int n) { return n * (n - 1) / 2; }
long long int MOD(long long int n, long long int mod) {
  if (n >= 0)
    return n % mod;
  else if (-n == mod)
    return 0;
  else
    return mod + (n % mod);
}
struct type {
  int x, y;
  long long int dis;
  char c;
};
int x, y, vis[10];
type data[500005];
bool cmp(type xx, type yy) { return xx.dis < yy.dis; }
int main() {
  int n;
  scanf("%d", &n);
  scanf("%d", &x);
  scanf("%d", &y);
  for (int i = 0; i < n; i++) {
    int a, b;
    char c;
    getchar();
    scanf("%c %d %d", &c, &a, &b);
    data[i].c = c;
    data[i].x = a;
    data[i].y = b;
    data[i].dis = (long long int)abs(x - a) + (long long int)abs(y - b);
  }
  sort(data, data + n, cmp);
  for (int i = 0; i < n; i++) {
    if (data[i].x == x) {
      if (data[i].y > y && !vis[1]) {
        if (data[i].c == 'Q' || data[i].c == 'R') {
          printf("YES\n");
          return 0;
        } else
          vis[1] = 1;
      } else if (data[i].y < y && !vis[2]) {
        if (data[i].c == 'Q' || data[i].c == 'R') {
          printf("YES\n");
          return 0;
        } else
          vis[2] = 1;
      }
    } else if (data[i].y == y) {
      if (data[i].x > x && !vis[3]) {
        if (data[i].c == 'Q' || data[i].c == 'R') {
          printf("YES\n");
          return 0;
        } else
          vis[3] = 1;
      } else if (data[i].x < x && !vis[4]) {
        if (data[i].c == 'Q' || data[i].c == 'R') {
          printf("YES\n");
          return 0;
        } else
          vis[4] = 1;
      }
    } else if (data[i].x - data[i].y == x - y) {
      if (data[i].x > x && data[i].y > y && !vis[5]) {
        if (data[i].c == 'Q' || data[i].c == 'B') {
          printf("YES\n");
          return 0;
        } else
          vis[5] = 1;
      } else if (data[i].x < x && data[i].y < y && !vis[7]) {
        if (data[i].c == 'Q' || data[i].c == 'B') {
          printf("YES\n");
          return 0;
        } else
          vis[7] = 1;
      }
    } else if (data[i].x + data[i].y == x + y) {
      if (data[i].x > x && data[i].y < y && !vis[8]) {
        if (data[i].c == 'Q' || data[i].c == 'B') {
          printf("YES\n");
          return 0;
        } else
          vis[8] = 1;
      } else if (data[i].x < x && data[i].y > y && !vis[6]) {
        if (data[i].c == 'Q' || data[i].c == 'B') {
          printf("YES\n");
          return 0;
        } else
          vis[6] = 1;
      }
    }
  }
  printf("NO\n");
  return 0;
}
