#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10, Msk = (1 << 17), inf = 1e9 + 10, MOD = 1e9 + 7,
          Sq = 708;
const long long INF = 1e18 + 10;
set<pair<int, char>> k1, k2, k3, k4;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int x, y;
  cin >> x >> y;
  for (int i = 0; i < n; i++) {
    char ch;
    int a, b;
    cin >> ch >> a >> b;
    if (a - b == x - y) k1.insert({a, ch});
    if (b + a == y + x) k2.insert({a, ch});
    if (a == x) k3.insert({b, ch});
    if (b == y) k4.insert({a, ch});
  }
  if (k1.size()) {
    auto h0 = k1.lower_bound({x, 0});
    auto h1 = h0;
    h1--;
    if (h0 != k1.end() && (h0->second == 'B' || h0->second == 'Q'))
      return cout << "YES", 0;
    if (h0 != k1.begin() && (h1->second == 'B' || h1->second == 'Q'))
      return cout << "YES", 0;
  }
  if (k2.size()) {
    auto h0 = k2.lower_bound({x, 0});
    auto h1 = h0;
    h1--;
    if (h0 != k2.begin() && (h1->second == 'B' || h1->second == 'Q'))
      return cout << "YES", 0;
    if (h0 != k2.end() && (h0->second == 'B' || h0->second == 'Q'))
      return cout << "YES", 0;
  }
  if (k4.size()) {
    auto h0 = k4.lower_bound({x, 0});
    auto h1 = h0;
    h1--;
    if (h0 != k4.end() && (h0->second == 'R' || h0->second == 'Q'))
      return cout << "YES", 0;
    if (h0 != k4.begin() && (h1->second == 'R' || h1->second == 'Q'))
      return cout << "YES", 0;
  }
  if (k3.size()) {
    auto h0 = k3.lower_bound({y, 0});
    auto h1 = h0;
    h1--;
    if (h0 != k3.end() && (h0->second == 'R' || h0->second == 'Q'))
      return cout << "YES", 0;
    if (h0 != k3.begin() && (h1->second == 'R' || h1->second == 'Q'))
      return cout << "YES", 0;
  }
  cout << "NO";
  return 0;
}
