#include <bits/stdc++.h>
using namespace std;
const int maxn = 500005;
struct ss {
  char op[2];
  long long x, y;
} ch[maxn];
int n;
long long kx, ky;
vector<ss> v1, v2, v3, v4, v5, v6, v7, v8;
bool cmp1(ss s1, ss s2) { return s1.y < s2.y; }
bool cmp2(ss s1, ss s2) { return !cmp1(s1, s2); }
bool cmp3(ss s1, ss s2) { return s1.x < s2.x; }
bool cmp4(ss s1, ss s2) { return !cmp3(s1, s2); }
bool cmp5(ss s1, ss s2) { return s1.x < s2.x; }
bool cmp6(ss s1, ss s2) { return !cmp5(s1, s2); }
bool cmp7(ss s1, ss s2) { return s1.x < s2.x; }
bool cmp8(ss s1, ss s2) { return !cmp7(s1, s2); }
int main() {
  while (scanf("%d%I64d%I64d", &n, &kx, &ky) == 3) {
    v1.clear();
    v2.clear();
    v3.clear();
    for (int i = 0; i < n; ++i)
      scanf("%s%I64d%I64d", ch[i].op, &ch[i].x, &ch[i].y);
    bool flag = false;
    for (int i = 0; i < n; ++i) {
      ch[i].x -= kx;
      ch[i].y -= ky;
      if (ch[i].x == 0 && ch[i].y == 0) flag = true;
      if (ch[i].x == 0) {
        if (ch[i].y > 0)
          v1.push_back(ch[i]);
        else
          v2.push_back(ch[i]);
      }
      if (ch[i].y == 0) {
        if (ch[i].x > 0) v3.push_back(ch[i]);
        if (ch[i].x < 0) v4.push_back(ch[i]);
      }
      if (ch[i].x == ch[i].y) {
        if (ch[i].x > 0) v5.push_back(ch[i]);
        if (ch[i].x < 0) v6.push_back(ch[i]);
      }
      if (ch[i].x == -ch[i].y) {
        if (ch[i].x > 0) v7.push_back(ch[i]);
        if (ch[i].x < 0) v8.push_back(ch[i]);
      }
    }
    if (flag) {
      puts("YES");
      continue;
    }
    sort(v1.begin(), v1.end(), cmp1);
    sort(v2.begin(), v2.end(), cmp2);
    sort(v3.begin(), v3.end(), cmp3);
    sort(v4.begin(), v4.end(), cmp4);
    sort(v5.begin(), v5.end(), cmp5);
    sort(v6.begin(), v6.end(), cmp6);
    sort(v7.begin(), v7.end(), cmp7);
    sort(v8.begin(), v8.end(), cmp8);
    for (unsigned i = 0; i < v1.size(); ++i)
      if (v1[i].op[0] == 'R' || v1[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    for (unsigned i = 0; i < v2.size(); ++i)
      if (v2[i].op[0] == 'R' || v2[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    for (unsigned i = 0; i < v3.size(); ++i)
      if (v3[i].op[0] == 'R' || v3[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    for (unsigned i = 0; i < v4.size(); ++i)
      if (v4[i].op[0] == 'R' || v4[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    for (unsigned i = 0; i < v5.size(); ++i)
      if (v5[i].op[0] == 'B' || v5[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    for (unsigned i = 0; i < v6.size(); ++i)
      if (v6[i].op[0] == 'B' || v6[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    for (unsigned i = 0; i < v7.size(); ++i)
      if (v7[i].op[0] == 'B' || v7[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    for (unsigned i = 0; i < v8.size(); ++i)
      if (v8[i].op[0] == 'B' || v8[i].op[0] == 'Q') {
        flag = true;
        break;
      } else
        break;
    if (flag) {
      puts("YES");
      continue;
    }
    if (!flag) puts("NO");
  }
  return 0;
}
