#include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) const string colors = "RB"; int colorid(char c){ return colors.find(c); } struct Ball{ int x,y,i; }; bool cmp_Ball_y(Ball l,Ball r){ return l.y>N; vector D[2]; rep(i,N){ char c,x; int y; cin>>c>>x>>y; D[colorid(c)].push_back({colorid(x),y,i}); } rep(i,2) sort(D[i].begin(),D[i].end(),cmp_Ball_y); bool ok=true; rep(i,2) rep(j,D[i].size()) if(D[i][j].y!=j) ok=false; if(ok){ cout<<"Yes"<