#include <bits/stdc++.h>
using namespace std;
struct Piece {
  char type;
  int x, y;
  int minus() const { return y - x; }
  int plus() const { return x + y; }
};
struct VertComp {
  bool operator()(const Piece &a, const Piece &b) {
    return a.x < b.x || (a.x == b.x && a.y < b.y);
  }
};
struct HorComp {
  bool operator()(const Piece &a, const Piece &b) {
    return a.y < b.y || (a.y == b.y && a.x < b.x);
  }
};
struct RightComp {
  bool operator()(const Piece &a, const Piece &b) {
    return a.minus() < b.minus() ||
           (a.minus() == b.minus() && a.plus() < b.plus());
  }
};
struct LeftComp {
  bool operator()(const Piece &a, const Piece &b) {
    return a.plus() < b.plus() ||
           (a.plus() == b.plus() && a.minus() < b.minus());
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int x0, y0;
  cin >> x0 >> y0;
  Piece king;
  king.x = x0;
  king.y = y0;
  king.type = 'K';
  vector<Piece> vert(n), hor, right, left;
  for (Piece &t : vert) {
    cin >> t.type >> t.x >> t.y;
  }
  hor = right = left = vert;
  sort(vert.begin(), vert.end(), VertComp());
  sort(hor.begin(), hor.end(), HorComp());
  sort(right.begin(), right.end(), RightComp());
  sort(left.begin(), left.end(), LeftComp());
  auto pos = lower_bound(vert.begin(), vert.end(), king, VertComp());
  if (pos != vert.end() && pos->x == king.x && pos->type != 'B') {
    cout << "YES";
    return 0;
  }
  if (pos != vert.begin() && (pos - 1)->x == king.x && (pos - 1)->type != 'B') {
    cout << "YES";
    return 0;
  }
  pos = lower_bound(hor.begin(), hor.end(), king, HorComp());
  if (pos != hor.end() && pos->y == king.y && pos->type != 'B') {
    cout << "YES";
    return 0;
  }
  if (pos != hor.begin() && (pos - 1)->y == king.y && (pos - 1)->type != 'B') {
    cout << "YES";
    return 0;
  }
  pos = lower_bound(right.begin(), right.end(), king, RightComp());
  if (pos != right.end() && pos->minus() == king.minus() && pos->type != 'R') {
    cout << "YES";
    return 0;
  }
  if (pos != right.begin() && (pos - 1)->minus() == king.minus() &&
      (pos - 1)->type != 'R') {
    cout << "YES";
    return 0;
  }
  pos = lower_bound(left.begin(), left.end(), king, LeftComp());
  if (pos != left.end() && pos->plus() == king.plus() && pos->type != 'R') {
    cout << "YES";
    return 0;
  }
  if (pos != left.begin() && (pos - 1)->plus() == king.plus() &&
      (pos - 1)->type != 'R') {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
