#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x0, y0;
  cin >> n >> x0 >> y0;
  long long int d1p = 9999999999, d1n = -9999999999, d2p = 9999999999,
                d2n = -9999999999, d3p = 9999999999, d3n = -9999999999,
                d4p = 9999999999, d4n = -9999999999, i1p = 9999999999,
                i1n = 9999999999, i2p = 9999999999, i2n = 9999999999,
                i3p = 9999999999, i3n = 9999999999, i4p = 9999999999,
                i4n = 9999999999;
  long long x[n], y[n];
  char c;
  string s = "";
  int i;
  for (i = 0; i < n; i++) {
    cin >> c >> x[i] >> y[i];
    s += c;
    if (y[i] == y0) {
      if (x[i] - x0 > 0 && x[i] - x0 < d1p) {
        d1p = x[i] - x0;
        i1p = i;
      } else if (x[i] - x0 < 0 && x[i] - x0 > d1n) {
        d1n = x[i] - x0;
        i1n = i;
      }
    } else if (x[i] == x0) {
      if (y[i] - y0 > 0 && y[i] - y0 < d2p) {
        d2p = y[i] - y0;
        i2p = i;
      } else if (y[i] - y0 < 0 && y[i] - y0 > d2n) {
        d2n = y[i] - y0;
        i2n = i;
      }
    } else if (y[i] == x[i] + y0 - x0) {
      if (y[i] - y0 > 0 && y[i] - y0 < d3p) {
        d3p = y[i] - y0;
        i3p = i;
      } else if (y[i] - y0 < 0 && y[i] - y0 > d3n) {
        d3n = y[i] - y0;
        i3n = i;
      }
    } else if (y[i] + x[i] == y0 + x0) {
      if (y[i] - y0 > 0 && y[i] - y0 < d4p) {
        d4p = y[i] - y0;
        i4p = i;
      } else if (y[i] - y0 < 0 && y[i] - y0 > d4n) {
        d4n = y[i] - y0;
        i4n = i;
      }
    }
  }
  if ((i1p != 9999999999 && s[i1p] != 'B') ||
      (i1n != 9999999999 && s[i1n] != 'B') ||
      (i2p != 9999999999 && s[i2p] != 'B') ||
      (i2n != 9999999999 && s[i2n] != 'B') ||
      (i3p != 9999999999 && s[i3p] != 'R') ||
      (i3n != 9999999999 && s[i3n] != 'R') ||
      (i4p != 9999999999 && s[i4p] != 'R') ||
      (i4n != 9999999999 && s[i4n] != 'R')) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
