#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 500000, MAX_VAL = 1000000000, MIN_VAL = -1000000000;
int n, x[MAX_N + 1], y[MAX_N + 1], type[3][3], length[3][3];
char c[MAX_N + 1];
void calc(int t, int x0, int y0) {
  int i = -1, j = -1, l;
  if (x0 == x[0]) {
    l = y0 - y[0];
    i = 0, j = 1;
    if (l < 0) {
      i = 2;
      l *= -1;
    }
  }
  if (y0 == y[0]) {
    l = x0 - x[0];
    i = 1, j = 2;
    if (l < 0) {
      j = 0;
      l *= -1;
    }
  }
  if (x0 - y0 == x[0] - y[0]) {
    l = x0 - x[0];
    i = 0, j = 2;
    if (l < 0) {
      i = 2, j = 0;
      l *= -1;
    }
  }
  if (x0 + y0 == x[0] + y[0]) {
    l = x0 - x[0];
    i = 2, j = 0;
    if (l < 0) {
      i = 0, j = 0;
      l *= -1;
    }
  }
  if (i != -1 && j != -1 && l < length[i][j]) {
    type[i][j] = t;
    length[i][j] = l;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  cin >> n;
  cin >> x[0] >> y[0];
  for (int i = 1; i <= n; i++) {
    cin >> c[i] >> x[i] >> y[i];
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      type[i][j] = 0;
      length[i][j] = MAX_VAL - MIN_VAL + 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (c[i] == 'B') {
      calc(1, x[i], y[i]);
    }
    if (c[i] == 'R') {
      calc(2, x[i], y[i]);
    }
    if (c[i] == 'Q') {
      calc(3, x[i], y[i]);
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (type[i][j] == 3) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  if (type[0][0] == 1 || type[0][2] == 1 || type[2][0] == 1 ||
      type[2][2] == 1) {
    cout << "YES" << endl;
    return 0;
  }
  if (type[0][1] == 2 || type[1][0] == 2 || type[1][2] == 2 ||
      type[2][1] == 2) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
