#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long>> a, b, c, d;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, x, y;
  cin >> n >> x >> y;
  long long f = 0;
  for (int i = 0; i < n; i++) {
    long long u, v, w;
    char k;
    cin >> k >> u >> v;
    if (k == 'B')
      w = 1;
    else if (k == 'R')
      w = 2;
    else
      w = 3;
    if (u == x) a.push_back(make_pair(v, w));
    if (v == y) b.push_back(make_pair(u, w));
    if ((x - u) == (y - v)) c.push_back(make_pair(u + v, w));
    if ((x - u) == (v - y)) d.push_back(make_pair(u - v, w));
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());
  sort(d.begin(), d.end());
  if (a.size() != 0) {
    long long pos =
        lower_bound(a.begin(), a.end(), make_pair(y, 0LL)) - a.begin();
    if (pos < a.size()) {
      if (a[pos].second != 1) f = 1;
    }
    pos--;
    if (pos >= 0) {
      if (a[pos].second != 1) f = 1;
    }
  }
  if (b.size() != 0) {
    long long pos =
        lower_bound(b.begin(), b.end(), make_pair(x, 0LL)) - b.begin();
    if (pos < b.size()) {
      if (b[pos].second != 1) f = 1;
    }
    pos--;
    if (pos >= 0) {
      if (b[pos].second != 1) f = 1;
    }
  }
  if (c.size() != 0) {
    long long pos =
        lower_bound(c.begin(), c.end(), make_pair(x + y, 0LL)) - c.begin();
    if (pos < c.size()) {
      if (c[pos].second != 2) f = 1;
    }
    pos--;
    if (pos >= 0) {
      if (c[pos].second != 2) f = 1;
    }
  }
  if (d.size() != 0) {
    long long pos =
        lower_bound(d.begin(), d.end(), make_pair(x - y, 0LL)) - d.begin();
    if (pos < d.size()) {
      if (d[pos].second != 2) f = 1;
    }
    pos--;
    if (pos >= 0) {
      if (d[pos].second != 2) f = 1;
    }
  }
  if (f)
    cout << "YES";
  else
    cout << "NO";
}
