#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
struct ss {
  long long x, y;
  double dis;
  char ch;
};
ss hengle, hengri, shuup, shudown, leup, riup, ledown, ridown;
bool cmp(ss i, ss j) { return i.dis < j.dis; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long xo, yo, x, y, n;
  char t;
  ss temp;
  cin >> n >> xo >> yo;
  hengle.dis = 1e18;
  hengri.dis = 1e18;
  shuup.dis = 1e18;
  shudown.dis = 1e18;
  leup.dis = 1e18;
  riup.dis = 1e18;
  ledown.dis = 1e18;
  ridown.dis = 1e18;
  leup.ch = 'R';
  riup.ch = 'R';
  ledown.ch = 'R';
  ridown.ch = 'R';
  for (int i = 1; i <= n; i++) {
    cin >> t >> x >> y;
    temp.x = x;
    temp.y = y;
    temp.ch = t;
    temp.dis = sqrt((x - xo) * (x - xo) + (y - yo) * (y - yo));
    if (x == xo) {
      if (y < yo) {
        if (temp.dis < hengle.dis) hengle = temp;
      } else {
        if (temp.dis < hengri.dis) hengri = temp;
      }
    } else if (y == yo) {
      if (x > xo) {
        if (temp.dis < shuup.dis) shuup = temp;
      } else {
        if (temp.dis < shudown.dis) shudown = temp;
      }
    } else if (x + y == xo + yo) {
      if (x < xo) {
        if (temp.dis < riup.dis) riup = temp;
      } else {
        if (temp.dis < ledown.dis) ledown = temp;
      }
    } else if (x - y == xo - yo) {
      if (x < xo) {
        if (temp.dis < leup.dis) leup = temp;
      } else {
        if (temp.dis < ridown.dis) ridown = temp;
      }
    }
  }
  if ((hengle.dis != 1e18 && hengle.ch != 'B') ||
      (hengri.dis != 1e18 && hengri.ch != 'B') ||
      (shuup.dis != 1e18 && shuup.ch != 'B') ||
      (shudown.dis != 1e18 && shudown.ch != 'B')) {
    cout << "YES\n";
    return 0;
  }
  if (leup.ch != 'R' || riup.ch != 'R' || ledown.ch != 'R' ||
      ridown.ch != 'R') {
    cout << "YES\n";
    return 0;
  }
  cout << "NO\n";
  return 0;
}
