#include<iostream>
#include<cstdio>#include<algorithm>#include<cmath>#include<cstring>using namespace std;int x[10],y[10];int dangerous[17][17];char z[10];int vis[17][17];char s[100][100];int main(){ int n; while(~scanf("%d",&n)){ memset(x,0,sizeof(x)); memset(y,0,sizeof(y)); memset(z,0,sizeof(z)); memset(vis,0,sizeof(vis)); memset(s,0,sizeof(s)); memset(dangerous,0,sizeof(dangerous)); int a,b; scanf("%d%d",&a,&b); if(n==0) break; for(int i=1;i<=n;i++){ cin>>z[i]>>x[i]>>y[i];//getchar();scanf("%c%d%d",&z[i],&x[i],&y[i]);这种输入过不了 vis[x[i]][y[i]]=1; } int flag=0; for(int i=1;i<=n;i++){ flag=0; if(z[i]=='G'){ for(int j=x[i]-1;j>=1;j--){ if(!vis[j][y[i]]) dangerous[j][y[i]]=1; else{ dangerous[j][y[i]]=1; break; } } if(b==y[i]){ flag=0; for(int ii=a+1;ii<x[i];ii++){ if(vis[ii][b]==1) flag=1; } if(!flag){ printf("NO\n"); flag=10; break; } } } else if(z[i]=='R'){ int ii=0; for(ii=x[i]-1;ii>=1;ii--){ if(!vis[ii][y[i]]) dangerous[ii][y[i]]=1; else{ dangerous[ii][y[i]]=1; break; } } //dangerous[ii][y[i]]=1; for(ii=x[i]+1;ii<=10;ii++){ if(!vis[ii][y[i]]) dangerous[ii][y[i]]=1; else{ dangerous[ii][y[i]]=1; break; } } //dangerous[ii][y[i]]=1; for(ii=y[i]-1;ii>=1;ii--){ if(vis[x[i]][ii]==0) dangerous[x[i]][ii]=1; else{ dangerous[x[i]][ii]=1; break; } } //dangerous[x[i]][ii]=1; for(ii=y[i]+1;ii<=9;ii++){ if(vis[x[i]][ii]==0) dangerous[x[i]][ii]=1; else{ dangerous[x[i]][ii]=1; break; } } //dangerous[x[i]][ii]=1; } else if(z[i]=='C'){ flag=0; for(int ii=x[i]-1;ii>=2;ii--){ if(vis[ii][y[i]]==1){ flag=ii; break; } } if(flag){ for(int ii=flag-1;ii>=1;ii--){ if(vis[ii][y[i]]==0) dangerous[ii][y[i]]=1; else{ dangerous[ii][y[i]]=1; break; } } } flag=0; for(int ii=x[i]+1;ii<=9;ii++){ if(vis[ii][y[i]]==1){ flag=ii; break; } } if(flag){ for(int ii=flag+1;ii<=10;ii++){ if(vis[ii][y[i]]==0) dangerous[ii][y[i]]=1; else{ dangerous[ii][y[i]]=1; break; } } } flag=0; for(int ii=y[i]-1;ii>=2;ii--){ if(vis[x[i]][ii]==1){ flag=ii; break; } } if(flag){ for(int ii=flag-1;ii>=1;ii--){ if(vis[x[i]][ii]==0) dangerous[x[i]][ii]=1; else{ dangerous[x[i]][ii]=1; break; } } } flag=0; for(int ii=y[i]+1;ii<=8;ii++){ if(vis[x[i]][ii]==1){ flag=ii; break; } } if(flag){ for(int ii=flag+1;ii<=9;ii++){ if(vis[x[i]][ii]==0) dangerous[x[i]][ii]=1; else{ dangerous[x[i]][ii]=1; break; } } } } else if(z[i]=='H'){ if(vis[x[i]-1][y[i]]==0){ //if(!vis[x[i]-2][y[i]-1]) dangerous[x[i]-2][y[i]-1]=1; //if(!vis[x[i]-2][y[i]+1]) dangerous[x[i]-2][y[i]+1]=1; } if(vis[x[i]+1][y[i]]==0){ //if(!vis[x[i]+2][y[i]-1]) dangerous[x[i]+2][y[i]-1]=1; //if(!vis[x[i]+2][y[i]+1]) dangerous[x[i]+2][y[i]+1]=1; } if(vis[x[i]][y[i]-1]==0){ //if(!vis[x[i]-1][y[i]-2]) dangerous[x[i]-1][y[i]-2]=1; //if(!vis[x[i]+1][y[i]-2]) dangerous[x[i]+1][y[i]-2]=1; } if(vis[x[i]][y[i]+1]==0){ //if(!vis[x[i]-1][y[i]+2]) dangerous[x[i]-1][y[i]+2]=1; //if(!vis[x[i]+1][y[i]+2]) dangerous[x[i]+1][y[i]+2]=1; } } } if(flag==10) continue; flag=0; if(a-1>=1) if(!dangerous[a-1][b]) flag=1; if(a+1<=3) if(!dangerous[a+1][b]) flag=1; if(b-1>=4) if(!dangerous[a][b-1]) flag=1; if(b+1<=6) if(!dangerous[a][b+1]) flag=1; if(flag) printf("NO\n"); else printf("YES\n"); } return 0;}