#include <bits/stdc++.h>
using namespace std;
const long long inff = 0x3f3f3f3f3f3f3f3f;
long long n, x, y, z;
pair<long long, char> c[9];
struct as {
  char q;
  long long x, y;
} a[500008];
int main() {
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x >> y;
  for (int i(1); i <= (8); ++i) c[i].first = inff;
  for (int i(1); i <= (n); ++i) {
    getchar();
    scanf("%c", &a[i].q);
    scanf("%I64d", &a[i].x), scanf("%I64d", &a[i].y);
    if (a[i].y == y && a[i].x < x && x - a[i].x < c[1].first) {
      c[1].second = a[i].q;
      c[1].first = x - a[i].x;
    }
    if (a[i].y == y && a[i].x > x && a[i].x - x < c[2].first) {
      c[2].second = a[i].q;
      c[2].first = a[i].x - x;
    }
    if (a[i].x == x && a[i].y < y && y - a[i].y < c[3].first) {
      c[3].second = a[i].q;
      c[3].first = y - a[i].y;
    }
    if (a[i].x == x && a[i].y > y && a[i].y - y < c[4].first) {
      c[4].second = a[i].q;
      c[4].first = a[i].y - y;
    }
    if (a[i].x < x && a[i].y < y && x - a[i].x == y - a[i].y &&
        x - a[i].x < c[5].first) {
      c[5].second = a[i].q;
      c[5].first = x - a[i].x;
    }
    if (a[i].x < x && a[i].y > y && x - a[i].x == a[i].y - y &&
        x - a[i].x < c[6].first) {
      c[6].second = a[i].q;
      c[6].first = x - a[i].x;
    }
    if (a[i].x > x && a[i].y < y && a[i].x - x == y - a[i].y &&
        a[i].x - x < c[7].first) {
      c[7].second = a[i].q;
      c[7].first = a[i].x - x;
    }
    if (a[i].x > x && a[i].y > y && a[i].x - x == a[i].y - y &&
        a[i].x - x < c[8].first) {
      c[8].second = a[i].q;
      c[8].first = a[i].x - x;
    }
  }
  for (int i(1); i <= (4); ++i) {
    if (c[i].second == 'R' || c[i].second == 'Q') {
      puts("YES");
      return 0;
    }
  }
  for (int i(5); i <= (8); ++i) {
    if (c[i].second == 'B' || c[i].second == 'Q') {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
