#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> near[9];
long long code(char A) {
  if (A == 'B')
    return 1;
  else if (A == 'R')
    return 2;
  else
    return 3;
}
int main() {
  long long a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q;
  char A, B, C, D, E;
  scanf("%lld", &a);
  scanf("%lld %lld", &b, &c);
  memset(near, -1, sizeof near);
  near[1].first = near[2].first = near[5].first = near[7].first = -1e18;
  near[3].first = near[4].first = near[6].first = near[8].first = 1e18;
  for (d = 1; d <= a; d++) {
    scanf(" %c %lld %lld", &A, &e, &f);
    if (abs(e - b) == abs(f - c)) {
      if (e < b && f < c)
        near[1] = max(near[1], {e, code(A)});
      else if (e < b && f > c)
        near[2] = max(near[2], {e, code(A)});
      else if (e > b && f < c)
        near[3] = min(near[3], {e, code(A)});
      else
        near[4] = min(near[4], {e, code(A)});
    } else if (e == b || f == c) {
      if (f < c)
        near[5] = max(near[5], {f, code(A)});
      else if (f > c)
        near[6] = min(near[6], {f, code(A)});
      else if (e < b)
        near[7] = max(near[7], {e, code(A)});
      else
        near[8] = min(near[8], {e, code(A)});
    }
  }
  for (d = 1; d <= 4; d++) {
    if (near[d].second == 1 || near[d].second == 3) {
      printf("YES\n");
      return 0;
    }
  }
  for (d = 5; d <= 8; d++) {
    if (near[d].second == 2 || near[d].second == 3) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
