#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
const int mod = 1000000000 + 7;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
struct node {
  long long x, y;
  string name;
  node() { name = ""; }
};
int main() {
  int n;
  long long x, y, a, b;
  string name;
  cin >> n;
  cin >> x >> y;
  node dic[15];
  for (int i = 1; i <= n; i++) {
    cin >> name >> a >> b;
    if (a == x) {
      if (dic[2].name == "" && b > y) {
        dic[2].x = a;
        dic[2].y = b;
        dic[2].name = name;
      }
      if (dic[8].name == "" && b < y) {
        dic[8].x = a;
        dic[8].y = b;
        dic[8].name = name;
      }
      if (dic[8].y < b && b < y) {
        dic[8].y = b;
        dic[8].name = name;
      } else if (dic[2].y > b && b > y) {
        dic[2].y = b;
        dic[2].name = name;
      }
    } else if (b == y) {
      if (dic[4].name == "" && a < x) {
        dic[4].x = a;
        dic[4].y = b;
        dic[4].name = name;
      }
      if (dic[6].name == "" && a > x) {
        dic[6].x = a;
        dic[6].y = b;
        dic[6].name = name;
      }
      if (dic[4].x < a && a < x) {
        dic[4].x = a;
        dic[4].name = name;
      } else if (dic[6].x > a && a > x) {
        dic[6].x = a;
        dic[6].name = name;
      }
    } else if (a + b == x + y) {
      if (dic[1].name == "" && a - b < x - y) {
        dic[1].x = a;
        dic[1].y = b;
        dic[1].name = name;
      }
      if (dic[9].name == "" && a - b > x - y) {
        dic[9].x = a;
        dic[9].y = b;
        dic[9].name = name;
      }
      if (dic[1].x - dic[1].y < a - b && a - b < x - y) {
        dic[1].x = a;
        dic[1].y = b;
        dic[1].name = name;
      } else if (dic[9].x - dic[9].y > a - b && a - b > x - y) {
        dic[9].x = a;
        dic[9].y = b;
        dic[9].name = name;
      }
    } else if (a - b == x - y) {
      if (dic[3].name == "" && a + b > x + y) {
        dic[3].x = a;
        dic[3].y = b;
        dic[3].name = name;
      }
      if (dic[7].name == "" && a + b < x + y) {
        dic[7].x = a;
        dic[7].y = b;
        dic[7].name = name;
      }
      if (dic[3].x + dic[3].y > a + b && a + b > x + y) {
        dic[3].x = a;
        dic[3].y = b;
        dic[3].name = name;
      }
      if (dic[7].x + dic[7].y < a + b && a + b < x + y) {
        dic[7].x = a;
        dic[7].y = b;
        dic[7].name = name;
      }
    }
  }
  if (dic[1].name == "Q" || dic[1].name == "B") {
    puts("YES");
  } else if (dic[9].name == "Q" || dic[9].name == "B") {
    puts("YES");
  } else if (dic[3].name == "Q" || dic[3].name == "B") {
    puts("YES");
  } else if (dic[7].name == "Q" || dic[7].name == "B") {
    puts("YES");
  } else if (dic[2].name == "Q" || dic[2].name == "R") {
    puts("YES");
  } else if (dic[8].name == "Q" || dic[8].name == "R") {
    puts("YES");
  } else if (dic[4].name == "Q" || dic[4].name == "R") {
    puts("YES");
  } else if (dic[6].name == "Q" || dic[6].name == "R") {
    puts("YES");
  } else {
    puts("NO");
  }
  return 0;
}
