#include <bits/stdc++.h>
template <typename N>
N gcd(N a, N b) {
  return b ? gcd(b, a % b) : a;
}
using namespace std;
struct u {
  char a;
  long long p, q;
};
struct b {
  char a;
  long long p, q;
};
struct c {
  char a;
  long long p, q;
};
struct d {
  char a;
  long long p, q;
};
struct e {
  char a;
  long long p, q;
};
struct f {
  char a;
  long long p, q;
};
struct g {
  char a;
  long long p, q;
};
struct h {
  char a;
  long long p, q;
};
int main(void) {
  u uu = {'Z', 0, 0};
  b bb = {'Z', 0, 0};
  c cc = {'Z', 0, 0};
  d dd = {'Z', 0, 0};
  e ee = {'Z', 0, 0};
  f ff = {'Z', 0, 0};
  g gg = {'Z', 0, 0};
  h hh = {'Z', 0, 0};
  int n, px, py;
  int posx, posy;
  int aaa = 2147483647;
  int bbb = 2147483647;
  int ccc = 2147483647;
  int ddd = 2147483647;
  int eee = 2147483647;
  int fff = 2147483647;
  int ggg = 2147483647;
  int hhh = 2147483647;
  char temp;
  cin >> n;
  cin >> px >> py;
  for (int i = (1), _ed = (n); i <= _ed; i++) {
    getchar();
    scanf("%c%d%d", &temp, &posx, &posy);
    if (posx == px && posy > py && abs(posy - py) < bbb) {
      bb.a = temp;
      bb.p = posx;
      bb.q = posy;
      bbb = abs(posy - py);
    } else if (posx == px && posy < py && abs(posy - py) < fff) {
      ff.a = temp;
      ff.p = posx;
      ff.q = posy;
      fff = abs(posy - py);
    } else if (posy == py && posx < px && abs(posx - px) < hhh) {
      hh.a = temp;
      hh.p = posx;
      hh.q = posy;
      hhh = abs(posx - px);
    } else if (posy == py && posx > px && abs(posx - px) < ddd) {
      dd.a = temp;
      dd.p = posx;
      dd.q = posy;
      ddd = abs(posx - px);
    } else if (posx + posy == px + py && posy < py && abs(posy - py) < ggg) {
      gg.a = temp;
      gg.p = posx;
      gg.q = posy;
      ggg = abs(posy - py);
    } else if (posx + posy == px + py && posy > py && abs(posy - py) < ccc) {
      cc.a = temp;
      cc.p = posx;
      cc.q = posy;
      ccc = abs(posy - py);
    } else if (posx - posy == px - py && posy > py && abs(posy - py) < aaa) {
      uu.a = temp;
      uu.p = posx;
      uu.q = posy;
      aaa = abs(posy - py);
    } else if (posx - posy == px - py && posy < py && abs(posy - py) < eee) {
      ee.a = temp;
      ee.p = posx;
      ee.q = posy;
      eee = abs(posy - py);
    }
  }
  if (uu.a == 'B' || uu.a == 'Q' || bb.a == 'R' || bb.a == 'Q' || cc.a == 'B' ||
      cc.a == 'Q' || dd.a == 'R' || dd.a == 'Q' || ee.a == 'B' || ee.a == 'Q' ||
      ff.a == 'R' || ff.a == 'Q' || gg.a == 'B' || gg.a == 'Q' || hh.a == 'R' ||
      hh.a == 'Q')
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
