#include <bits/stdc++.h>
struct piece {
  char type;
  int x, y;
};
int main(void) {
  std::ios_base::sync_with_stdio(false);
  int enemy;
  while (std::cin >> enemy) {
    int kx, ky;
    std::cin >> kx >> ky;
    bool check = false;
    piece dia[4], str[4];
    bool setd[4], sets[4];
    for (int j = 0; j < 4; j++) {
      setd[j] = false;
      sets[j] = false;
    }
    for (int i = 1; i <= enemy; i++) {
      piece temp;
      std::cin >> temp.type >> temp.x >> temp.y;
      temp.x = temp.x - kx;
      temp.y = temp.y - ky;
      if (temp.x == 0) {
        if (temp.y > 0) {
          if (sets[1] == false) {
            sets[1] = true;
            str[1] = temp;
          } else if (str[1].y > temp.y)
            str[1] = temp;
        } else {
          if (sets[3] == false) {
            sets[3] = true;
            str[3] = temp;
          } else if (str[3].y < temp.y)
            str[3] = temp;
        }
      }
      if (temp.y == 0) {
        if (temp.x > 0) {
          if (sets[2] == false) {
            sets[2] = true;
            str[2] = temp;
          } else if (str[2].x > temp.x)
            str[2] = temp;
        } else {
          if (sets[0] == false) {
            sets[0] = true;
            str[0] = temp;
          } else if (str[0].x < temp.x)
            str[0] = temp;
        }
      }
      if (abs(temp.x) == abs(temp.y)) {
        if (temp.x > 0 && temp.y > 0) {
          if (setd[0] == false) {
            setd[0] = true;
            dia[0] = temp;
          } else if (temp.x < dia[0].x)
            dia[0] = temp;
        }
        if (temp.x < 0 && temp.y > 0) {
          if (setd[1] == false) {
            setd[1] = true;
            dia[1] = temp;
          } else if (temp.y < dia[1].y) {
            dia[1] = temp;
          }
        }
        if (temp.x < 0 && temp.y < 0) {
          if (setd[2] == false) {
            setd[2] = true;
            dia[2] = temp;
          } else if (temp.x > dia[2].x) {
            dia[2] = temp;
          }
        }
        if (temp.x > 0 && temp.y < 0) {
          if (setd[3] == false) {
            setd[3] = true;
            dia[3] = temp;
          } else if (temp.x < dia[3].x) {
            dia[3] = temp;
          }
        }
      }
    }
    for (int i = 0; i < 4; i++) {
      if (dia[i].type == 'B' || dia[i].type == 'Q') check = true;
      if (str[i].type == 'R' || str[i].type == 'Q') check = true;
    }
    if (check == true)
      std::cout << "YES\n";
    else
      std::cout << "NO\n";
  }
}
