#include <bits/stdc++.h>
const int oo = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double EPS = 1e-8;
using namespace std;
int read() {
  int d, f = 1;
  char c;
  while (!isdigit(c = getchar()))
    if (c == '-') f = -1;
  d = c ^ '0';
  while (isdigit(c = getchar())) d = (d * 10) + (c ^ '0');
  return d * f;
}
void rekt() {
  puts("YES");
  exit(0);
}
int main() {
  int n;
  while (cin >> n) {
    int x0 = read(), y0 = read();
    pair<long long, char> dir[8];
    for (int i = 0; i < 8; ++i) dir[i].first = 1000000000000000000ll;
    for (int i = 0; i < n; ++i) {
      char c[2];
      scanf("%s", c);
      int x = read(), y = read();
      if (y == y0) {
        if (x < x0 && x0 - x < dir[0].first)
          dir[0].first = x0 - x, dir[0].second = c[0];
        else if (x > x0 && x - x0 < dir[1].first)
          dir[1].first = x - x0, dir[1].second = c[0];
      } else if (x == x0) {
        if (y < y0 && y0 - y < dir[2].first)
          dir[2].first = y0 - y, dir[2].second = c[0];
        else if (y > y0 && y - y0 < dir[3].first)
          dir[3].first = y - y0, dir[3].second = c[0];
      } else if (abs(x - x0) == abs(y - y0)) {
        if (x < x0 && y < y0 && x0 - x < dir[4].first)
          dir[4].first = x0 - x, dir[4].second = c[0];
        else if (x > x0 && y < y0 && x - x0 < dir[5].first)
          dir[5].first = x - x0, dir[5].second = c[0];
        else if (x < x0 && y > y0 && x0 - x < dir[6].first)
          dir[6].first = x0 - x, dir[6].second = c[0];
        else if (x > x0 && y > y0 && x - x0 < dir[7].first)
          dir[7].first = x - x0, dir[7].second = c[0];
      }
    }
    for (int i = 0; i < 4; ++i)
      if (dir[i].second == 'R' || dir[i].second == 'Q') rekt();
    for (int i = 4; i < 8; ++i)
      if (dir[i].second == 'B' || dir[i].second == 'Q') rekt();
    puts("NO");
  }
  return 0;
}
