#include <bits/stdc++.h>
using namespace std;
int Bx1, Bx2, By1, By2;
char CC[600000];
int xx[600000], yy[600000];
int main() {
  int x, y, n, first, second, St = 0;
  char C;
  int Rx[5], Ry[5];
  for (int i = 0; i < 4; i++) Rx[i] = Ry[i] = 2000000011;
  cin >> n;
  cin >> first >> second;
  Bx1 = By1 = 2000000011;
  Bx2 = By2 = 2000000011;
  for (int i = 0; i < n; i++) {
    cin >> C >> x >> y;
    CC[i] = C;
    xx[i] = x;
    yy[i] = y;
    if (C == 'R') {
      if (abs(first - x) == abs(second - y)) {
        if (x > first && y > second) {
          Rx[0] = min(Rx[0], abs(first - x));
          Ry[0] = min(Ry[0], abs(second - y));
        }
        if (x > first && y < second) {
          Rx[1] = min(Rx[1], abs(first - x));
          Ry[1] = min(Ry[1], abs(second - y));
        }
        if (x < first && y > second) {
          Rx[2] = min(Rx[2], abs(first - x));
          Ry[2] = min(Ry[2], abs(second - y));
        }
        if (x < first && y < second) {
          Rx[3] = min(Rx[3], abs(first - x));
          Ry[3] = min(Ry[3], abs(second - y));
        }
      }
    }
    if (C == 'B') {
      if (y == second) {
        if (x > first) Bx2 = min(Bx2, x - first);
        if (first > x) Bx1 = min(Bx1, first - x);
      }
      if (x == first) {
        if (y > second) By2 = min(By2, y - second);
        if (second > y) By1 = min(By1, second - y);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    C = CC[i];
    x = xx[i];
    y = yy[i];
    if (C == 'R') {
      if (x == first) {
        if (y > second && y - second <= By2) St = 1;
        if (second > y && second - y <= By1) St = 1;
      }
      if (y == second) {
        if (x > first && x - first <= Bx2) St = 1;
        if (first > x && first - x <= Bx1) St = 1;
      }
    }
    if (C == 'B') {
      if (abs(first - x) == abs(second - y)) {
        if (x > first && y > second) {
          if (abs(x - first) <= Rx[0]) St = 1;
        }
        if (x > first && y < second) {
          if (abs(x - first) <= Rx[1]) St = 1;
        }
        if (x < first && y > second) {
          if (abs(x - first) <= Rx[2]) St = 1;
        }
        if (x < first && y < second) {
          if (abs(x - first) <= Rx[3]) St = 1;
        }
      }
    }
    if (C == 'Q') {
      if (x == first) {
        if (y > second && y - second <= By2) St = 1;
        if (second > y && second - y <= By1) St = 1;
      }
      if (y == second) {
        if (x > first && x - first <= Bx2) St = 1;
        if (first > x && first - x <= Bx1) St = 1;
      }
      if (abs(first - x) == abs(second - y)) {
        if (x > first && y > second) {
          if (abs(x - first) <= Rx[0]) St = 1;
        }
        if (x > first && y < second) {
          if (abs(x - first) <= Rx[1]) St = 1;
        }
        if (x < first && y > second) {
          if (abs(x - first) <= Rx[2]) St = 1;
        }
        if (x < first && y < second) {
          if (abs(x - first) <= Rx[3]) St = 1;
        }
      }
    }
  }
  if (St == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
