#include <bits/stdc++.h>
using namespace std;
unsigned long long fact(
    unsigned long long n,
    unsigned long long m = numeric_limits<unsigned long long>::max()) {
  return n ? n * fact(n - 1, m) % m : 1;
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return b ? gcd(b, a % b) : a;
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return a / gcd(a, b) * b;
}
unsigned long long qpow(
    unsigned long long a, unsigned long long b,
    unsigned long long m = numeric_limits<unsigned long long>::max()) {
  return b ? (b % 2 ? a : 1) * qpow(a * a % m, b / 2, m) % m : 1;
}
bool isPow2(unsigned long long x) { return !(x & (x - 1)); }
static const bool PARALLEL_MULTITEST = true;
static const bool MULTILINE_OUTPUT = false;
static const bool LAUNCH_STRESSTEST = false;
static const string INPUT_FILE = "";
static const string OUTPUT_FILE = "";
static const string DBG_INPUT_FILE = "input.txt";
static const string DBG_OUTPUT_FILE = "output.txt";
static const string DBG_ERROR_FILE = "error.txt";
struct Solver {
  long long n, kx, ky;
  struct Test {
    long long x, y;
    char t;
  };
  struct Ray {
    long long dist;
    char type;
    Ray() {
      dist = numeric_limits<long long>::max();
      type = 'N';
    }
  };
  vector<Test> tests;
  void readData(istream &cin) {
    cin >> n >> kx >> ky;
    tests.resize(n);
    for (auto &t : tests) {
      cin >> t.t >> t.x >> t.y;
    }
  }
  bool test_slon(long long x, long long y) {
    return abs(x - kx) == abs(y - ky);
  }
  bool test_lad(long long x, long long y) { return x == kx || y == ky; }
  pair<int, long long> get_ray(long long x, long long y) {
    if (test_slon(x, y)) {
      return make_pair<int, long long>(2 * (x < kx) + (y < ky), abs(x - kx));
    } else if (test_lad(x, y)) {
      long long dist = max(abs(x - kx), abs(y - ky));
      return make_pair(4 + 2 * (x == kx) + (x < kx || y < ky), dist);
    } else {
      return make_pair<int, long long>(-1, -1);
    }
  }
  void solve(ostream &cout, ostream &cerr) {
    bool res = false;
    Ray rays[8];
    for (const auto &t : tests) {
      auto ray = get_ray(t.x, t.y);
      if (ray.first == -1) {
        continue;
      }
      if (rays[ray.first].dist < ray.second) {
        continue;
      }
      rays[ray.first].type = t.t;
      rays[ray.first].dist = ray.second;
    }
    for (int i = (0); i <= (3); ++i) {
      if (rays[i].type == 'Q' || rays[i].type == 'B') {
        res = true;
      }
    }
    for (int i = (4); i <= (7); ++i) {
      if (rays[i].type == 'Q' || rays[i].type == 'R') {
        res = true;
      }
    }
    cout << (res ? "YES" : "NO") << endl;
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  if (!INPUT_FILE.empty()) freopen(INPUT_FILE.c_str(), "rt", stdin);
  if (!OUTPUT_FILE.empty()) freopen(OUTPUT_FILE.c_str(), "wt", stdout);
  auto solver = Solver();
  solver.readData(cin);
  solver.solve(cout, cerr);
  return 0;
}
