#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> q[9];
char s[2];
int main() {
  long long n, x0, y0;
  scanf("%lld", &n);
  scanf("%lld%lld", &x0, &y0);
  for (long long m = 0; m < 9; m++) q[m] = make_pair(1E10, INT_MAX);
  while (n--) {
    long long x, y, i, j, k, g, m, d;
    scanf("%s", s);
    scanf("%lld%lld", &x, &y);
    i = x - x0, j = y - y0;
    if (abs(i) != abs(j) && i != 0 && j != 0) continue;
    k = max(abs(i), abs(j));
    i /= k, j /= k;
    i++, j++;
    m = 3 * i + j;
    if (s[0] == 'Q')
      k = 3;
    else
      k = (s[0] != 'R') + 1;
    d = abs(x - x0) + abs(y - y0);
    q[m] = min(q[m], make_pair(d, k));
  }
  for (long long m = 0; m < 9; m++) {
    long long i = m / 3, j = m % 3, check;
    i--, j--;
    if (i == 0 || j == 0)
      check = 0;
    else
      check = 1;
    if (q[m].first != 1E10 && (q[m].second & (1 << check))) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
