#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int n, kx, ky, x, y;
char ty[567890];
int bst[567890], bid[567890];
int sgn(int a) { return a > 0 ? 1 : -1; }
int main() {
  scanf("%d %d %d", &n, &kx, &ky);
  for (int i = (0); i < (8); i++) bst[i] = 2e9 + 2, bid[i] = -1;
  for (int i = (0); i < (n); i++) {
    scanf(" %c %d %d", ty + i, &x, &y);
    int cx = kx - x, cy = ky - y, dst = max(abs(cx), abs(cy));
    for (int j = (0); j < (8); j++)
      if (cx * dy[j] == cy * dx[j] && sgn(cx) == sgn(dx[j]) &&
          sgn(cy) == sgn(dy[j])) {
        if (dst < bst[j]) bst[j] = dst, bid[j] = i;
      }
  }
  int g = 0;
  for (int j = (0); j < (4); j++)
    if (bid[j] != -1 && ty[bid[j]] != 'B') g = 1;
  for (int j = (4); j < (8); j++)
    if (bid[j] != -1 && ty[bid[j]] != 'R') g = 1;
  puts(g ? "YES" : "NO");
  return 0;
}
