#include <iostream>
#include<stdio.h>
using namespace std;
char m[15][15];
int dx[4] = { 1,-1,0,0 };
int dy[4] = { 0,0,1,-1 };
int cntx(int a, int b, int y)
{
if (a > b)
swap(a, b);
int cnt = 0;
for (int i = a + 1; i < b; i++)
{
if (m[i][y] != '\0')
{
cnt++;
}
}
return cnt;
}
int cnty(int a, int b, int x)
{
if (a > b)
swap(a, b);
int cnt = 0;
for (int i = a + 1; i < b; i++)
{
if (m[x][i] != '\0')
{
cnt++;
}
}
return cnt;
}
struct xiangqi
{
char type;
int x, y;
};
int main()
{
int ct = 1;
int n, bx, by;
// freopen("C:\\Users\\Lenovo\\Desktop\\out.txt", "w", stdout);
while (scanf("%d%d%d", &n, &bx, &by) != EOF && (n || bx || by))
{
xiangqi red[15];
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 15; j++)
{
m[i][j] = '\0';
}
}
char Type;
int tx, ty;
bool ans = false;
int gx=-1, gy=-1;
for (int i = 0; i < n; i++)
{
char t[2];
scanf("%s", t);
scanf("%d%d", &tx, &ty);
m[tx][ty] = t[0];
red[i].type = t[0];
red[i].x = tx;
red[i].y = ty;
if (t[0] == 'G')
{
gx = tx;
gy = ty;
}
}
if (by == gy && cntx(bx, gx, gy) == 0)
{
printf("NO\n");
continue;
}
for (int i = 0; i < 4; i++)
{
int nx = bx + dx[i];
int ny = by + dy[i];
if (nx > 3 || nx < 1 || ny>6 || ny < 4)
continue;
ans = false;
for (int j = 0; j < n; j++)
{
if (red[j].x == nx && red[j].y == ny)
continue;
if (red[j].type == 'G')
{
if (red[j].y == ny)
{
int num = cntx(red[j].x, nx, ny);
if (num == 0)
{
ans = true;
break;
}
}
}
else if (red[j].type == 'R')
{
if (red[j].x == nx)
{
int num = cnty(red[j].y, ny, nx);
if (num == 0)
{
ans = true;
break;
}
}
if (red[j].y == ny)
{
int num = cntx(red[j].x, nx, ny);
if (num == 0)
{
ans = true;
break;
}
}
}
else if (red[j].type == 'C')
{
if (red[j].x == nx)
{
int num = cnty(red[j].y, ny, nx);
if (num == 1)
{
ans = true;
break;
}
}
if (red[j].y == ny)
{
int num = cntx(red[j].x, nx, ny);
if (num == 1)
{
ans = true;
break;
}
}
}
else if (red[j].type == 'H')
{
int xx = red[j].x;
int yy = red[j].y;
int detx = nx - red[j].x;
int dety = ny - red[j].y;
if (detx == -2 && (dety == -1 || dety == 1) && m[xx - 1][yy] == '\0')
{
ans = true;
break;
}
else if (detx == 2 && (dety == -1 || dety == 1) && m[xx + 1][yy] == '\0')
{
ans = true;
break;
}
else if (dety == -2 && (detx == -1 || detx == 1) && m[xx][yy - 1] == '\0')
{
ans = true;
break;
}
else if (dety == 2 && (detx == -1 || detx == 1) && m[xx][yy + 1] == '\0')
{
ans = true;
break;
}
}
}
if (!ans)
break;
}
if (ans)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}