#include <bits/stdc++.h>
using namespace std;
struct par {
  char tip;
  long long x, y;
};
long long n, ix, iy, i, b;
bool cmp(par p1, par p2) {
  return (max(ix, p1.x) - min(ix, p1.x) + max(iy, p1.y) - min(iy, p1.y)) <=
         (max(ix, p2.x) - min(ix, p2.x) + max(iy, p2.y) - min(iy, p2.y));
}
par fig[500123];
map<long long, long long> gl, gd;
map<long long, long long> dl, dd;
int gor, des, lev, dol;
int main() {
  cin >> n;
  cin >> ix >> iy;
  for (i = 0; i < n; i++) {
    cin >> fig[i].tip;
    scanf("%I64d%I64d", &fig[i].x, &fig[i].y);
  }
  sort(fig, fig + n, cmp);
  for (i = 0; i < n; i++) {
    long long rav = 0, kos = 0;
    long long X = fig[i].x, Y = fig[i].y;
    if (fig[i].tip == 'R')
      rav = 1;
    else if (fig[i].tip == 'B')
      kos = 1;
    else
      rav = 1, kos = 1;
    if (X == ix) {
      if (Y > iy) {
        if (!gor && rav) {
          cout << "YES" << endl;
          return 0;
        }
        gor = 1;
      } else {
        if (!dol && rav) {
          cout << "YES" << endl;
          return 0;
        }
        dol = 1;
      }
    } else if (X < ix) {
      if (Y > iy) {
        if (!gl[X + Y] && X + Y == ix + iy && kos) {
          cout << "YES" << endl;
          return 0;
        }
        gl[X + Y] = 1;
      } else if (iy > Y) {
        if (!dl[X - Y] && X - Y == ix - iy && kos) {
          cout << "YES" << endl;
          return 0;
        }
        dl[X - Y] = 1;
      }
    } else {
      if (Y > iy) {
        if (!gd[X - Y] && X - Y == ix - iy && kos) {
          cout << "YES" << endl;
          return 0;
        }
        gd[X - Y] = 1;
      } else if (Y < iy) {
        if (!dd[X + Y] && X + Y == ix + iy && kos) {
          cout << "YES" << endl;
          return 0;
        }
        dd[X + Y] = 1;
      }
    }
    if (Y == iy) {
      if (X > ix) {
        if (!des && rav) {
          cout << "YES" << endl;
          return 0;
        }
        des = 1;
      } else {
        if (!lev && rav) {
          cout << "YES" << endl;
          return 0;
        }
        lev = 1;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
