#include <bits/stdc++.h>
using namespace std;
int n;
int xx, yy;
int ty[8];
int val[8];
int main() {
  cin >> n;
  cin >> xx >> yy;
  for (int i = 0; i < 8; i++) {
    ty[i] = -1;
  }
  for (int i = 0; i < n; i++) {
    char t;
    int x, y;
    cin >> t >> x >> y;
    if (x == xx) {
      if (y < yy) {
        if (ty[0] == -1) {
          ty[0] = t;
          val[0] = y;
        } else {
          if (val[0] < y) {
            val[0] = y;
            ty[0] = t;
          }
        }
      }
      if (yy < y) {
        if (ty[1] == -1) {
          ty[1] = t;
          val[1] = y;
        } else {
          if (val[1] > y) {
            val[1] = y;
            ty[1] = t;
          }
        }
      }
    }
    if (y == yy) {
      if (x < xx) {
        if (ty[2] == -1) {
          ty[2] = t;
          val[2] = x;
        } else {
          if (val[2] < x) {
            val[2] = x;
            ty[2] = t;
          }
        }
      }
      if (xx < x) {
        if (ty[3] == -1) {
          ty[3] = t;
          val[3] = x;
        } else {
          if (val[3] > x) {
            val[3] = x;
            ty[3] = t;
          }
        }
      }
    }
    if (x + y == xx + yy) {
      if (x - y < xx - yy) {
        if (ty[4] == -1) {
          ty[4] = t;
          val[4] = x - y;
        } else {
          if (val[4] < x - y) {
            val[4] = x - y;
            ty[4] = t;
          }
        }
      }
      if (x - y > xx - yy) {
        if (ty[5] == -1) {
          ty[5] = t;
          val[5] = x - y;
        } else {
          if (val[5] > x - y) {
            val[5] = x - y;
            ty[5] = t;
          }
        }
      }
    }
    if (x - y == xx - yy) {
      if (x + y < xx + yy) {
        if (ty[6] == -1) {
          ty[6] = t;
          val[6] = x + y;
        } else {
          if (val[6] < x + y) {
            val[6] = x + y;
            ty[6] = t;
          }
        }
      }
      if (x + y > xx + yy) {
        if (ty[7] == -1) {
          ty[7] = t;
          val[7] = x + y;
        } else {
          if (val[7] > x + y) {
            val[7] = x + y;
            ty[7] = t;
          }
        }
      }
    }
  }
  bool chked = false;
  for (int i = 0; i < 4; i++) {
    if (ty[i] == 'R' || ty[i] == 'Q') {
      chked = true;
    }
  }
  for (int i = 4; i < 8; i++) {
    if (ty[i] == 'B' || ty[i] == 'Q') {
      chked = true;
    }
  }
  if (chked) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
