#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e9;
const long long MOD = (long long)1e9 + 7;
const long double pi = atan2(0, -1);
const long long N = 1000000;
int main() {
  int n;
  scanf("%d", &n);
  int x0, y0;
  scanf("%d %d", &x0, &y0);
  int a[n][3];
  for (int i = 0; i < n; i++) {
    char c;
    scanf(" %c %d %d", &c, &a[i][1], &a[i][2]);
    if (c == 'B')
      a[i][0] = 0;
    else if (c == 'R')
      a[i][0] = 1;
    else
      a[i][0] = 2;
  }
  int t = 0;
  map<int, int> mi;
  for (int i = 0; i < n; i++) mi[a[i][1]] = 0;
  for (auto &i : mi) i.second = t++;
  vector<vector<int> > bi(t);
  for (int i = 0; i < n; i++) bi[mi[a[i][1]]].push_back(a[i][2]);
  for (int i = 0; i < t; i++) sort(bi[i].begin(), bi[i].end());
  t = 0;
  map<int, int> mj;
  for (int i = 0; i < n; i++) mj[a[i][2]] = 0;
  for (auto &i : mj) i.second = t++;
  vector<vector<int> > bj(t);
  for (int i = 0; i < n; i++) bj[mj[a[i][2]]].push_back(a[i][1]);
  for (int i = 0; i < t; i++) sort(bj[i].begin(), bj[i].end());
  t = 0;
  map<int, int> mij;
  for (int i = 0; i < n; i++) mij[a[i][2] - a[i][1]] = 0;
  for (auto &i : mij) i.second = t++;
  vector<vector<int> > bij(t);
  for (int i = 0; i < n; i++) bij[mij[a[i][2] - a[i][1]]].push_back(a[i][1]);
  for (int i = 0; i < t; i++) sort(bij[i].begin(), bij[i].end());
  t = 0;
  map<int, int> mji;
  for (int i = 0; i < n; i++) mji[a[i][1] + a[i][2]] = 0;
  for (auto &i : mji) i.second = t++;
  vector<vector<int> > bji(t);
  for (int i = 0; i < n; i++) bji[mji[a[i][1] + a[i][2]]].push_back(a[i][1]);
  for (int i = 0; i < t; i++) sort(bji[i].begin(), bji[i].end());
  for (int i = 0; i < n; i++) {
    if (a[i][0] == 0 || a[i][0] == 2) {
      int x = a[i][1], y = a[i][2], pp, pos;
      if (y - x == y0 - x0) {
        pp = mij[y - x],
        pos = lower_bound(bij[pp].begin(), bij[pp].end(), x) - bij[pp].begin();
        if (x0 < x && (pos == 0 || bij[pp][pos - 1] < x0) ||
            (x0 > x) &&
                (pos == (int)bij[pp].size() - 1 || bij[pp][pos + 1] > x0)) {
          printf("YES\n");
          return 0;
        }
      }
      if (x + y == x0 + y0) {
        pp = mji[x + y],
        pos = lower_bound(bji[pp].begin(), bji[pp].end(), x) - bji[pp].begin();
        if ((x0 < x && (pos == 0 || bji[pp][pos - 1] < x0)) ||
            ((x0 > x) &&
             (pos == (int)bji[pp].size() - 1 || bji[pp][pos + 1] > x0))) {
          printf("YES\n");
          return 0;
        }
      }
    }
    if (a[i][0] == 1 || a[i][0] == 2) {
      int x = a[i][1], y = a[i][2], pp, pos;
      if (x0 == x) {
        pp = mi[x],
        pos = lower_bound(bi[pp].begin(), bi[pp].end(), y) - bi[pp].begin();
        if (y0 < y && (pos == 0 || bi[pp][pos - 1] < y0) ||
            (y0 > y) &&
                (pos == (int)bi[pp].size() - 1 || bi[pp][pos + 1] > y0)) {
          printf("YES\n");
          return 0;
        }
      }
      if (y0 == y) {
        pp = mj[y],
        pos = lower_bound(bj[pp].begin(), bj[pp].end(), x) - bj[pp].begin();
        if (x0 < x && (pos == 0 || bj[pp][pos - 1] < x0) ||
            (x0 > x) &&
                (pos == (int)bj[pp].size() - 1 || bj[pp][pos + 1] > x0)) {
          printf("YES\n");
          return 0;
        }
      }
    }
  }
  printf("NO\n");
  return 0;
}
