#include<iostream>
using namespace std;
typedef struct node
{
int x,y;
char type;
}coordinate;
int main(void)
{
int n,m;
cin>>n>>m;
coordinate point[n];
for(int i=0;i<n;i++)
{
cin>>point[i].x>>point[i].y>>point[i].type;
}
int theta0[m],theta1[m],theta2[m];
for(int i=0;i<m;i++)
{
cin>>theta0[i]>>theta1[i]>>theta2[i];
}
for(int i=0;i<m;i++)
{
bool flag=(theta0[i]+(theta1[i]*point[0].x)+(theta2[i]*point[0].y))>0 ;
bool temp=true;
for(int j=1;j<n;j++)
{
if(point[j].type==point[0].type)
{
if(((theta0[i]+(theta1[i]*point[j].x)+(theta2[i]*point[j].y))>0)==flag)
continue;
else {
temp=false;
break;
}
}
else
{
if(((theta0[i]+(theta1[i]*point[j].x)+(theta2[i]*point[j].y))>0)!=flag)
continue;
else
{
temp=false;
break;
}
}
}
if(temp)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}