#include<bits/stdc++.h>
using namespace std;
#define int long long
struct node{
int x,y;
string str;
}f[200005];
bool cmp(node x,node y)
{
if(x.x!=y.x)
return x.x<y.x;
else return x.y<y.y;
}
bool cmp2(node x,node y)
{
if(x.y!=y.y)
return x.y<y.y;
else return x.x<y.x;
}
signed main()
{
int n,m;
cin>>n>>m;
for(int i=1;i<=m;i++)
cin>>f[i].x>>f[i].y>>f[i].str;
sort(f+1,f+m+1,cmp);
int flag=0,flag1=0,flag2=n+1,p=0;
for(int i=1;i<=m;i++)
{
if(f[i].y>flag2&&f[i].str=="B")
{
cout<<"No";
return 0;
}
if(f[i].x==flag)
{
if(flag1==0)
{
if(f[i].str=="W")
flag1=1;
else p=f[i].y;
}
else {
if(f[i].str=="B")
{
cout<<"No";
return 0;
}
}
}
else {
p=f[i].y;
flag2=min(p,flag2);
p=0;
flag=f[i].x;
if(f[i].str=="W")
flag1=1;
else flag1=0;
}
}
sort(f+1,f+m+1,cmp2);
flag=0,flag1=0,flag2=n+1,p=0;
for(int i=1;i<=m;i++)
{
if(f[i].x>flag2&&f[i].str=="B")
{
cout<<"No";
return 0;
}
if(f[i].y==flag)
{
if(flag1==0)
{
if(f[i].str=="W")
flag1=1;
else p=f[i].x;
}
else {
if(f[i].str=="B")
{
cout<<"No";
return 0;
}
}
}
else {
p=f[i].x;
flag2=min(p,flag2);
p=0;
flag=f[i].y;
if(f[i].str=="W")
flag1=1;
else flag1=0;
}
}
cout<<"Yes";
}