packagepractice;importjava.util.Scanner;importjavax.swing.text.StyledEditorKit.ForegroundAction;publicclass pc {publicstaticvoidmain(String args[]){Scanner sc =newScanner(System.in);int n = sc.nextInt();//点的个数int m = sc.nextInt();//线的个数int a =0;//A点的个数int b =0;//B点的个数int ra =0;//在线的一边的a点的个数int rb =0;//在线的一边的b点的个数int[]Ax=newint[n];int[]Ay=newint[n];int[]Bx=newint[n];int[]By=newint[n];String[] result =newString[m];//存储对应线是否为指定的线for(int i =0;i<n;i++){int x = sc.nextInt();//获取点的x坐标int y = sc.nextInt();//获取点的y坐标char ch = sc.next().charAt(0);//获取指定的A或者B点if(ch =='A'){Ax[a]= x;Ay[a]= y;
a++;}elseif(ch =='B'){Bx[b]= x;By[b]= y;
b++;}}for(int i =0; i < m; i++){//获取线进行判断int a0 = sc.nextInt();int a1 = sc.nextInt();int a2 = sc.nextInt();for(int t =0; t < a; t++){//依次带入A点int at = a0+a1*Ax[t]+a2*Ay[t];if(at>0){
ra++;}}for(int q =0; q < b; q++){//依次带入B点int bt = a0+a1*Bx[q]+a2*By[q];if(bt>0){
rb++;}}if((ra==a&&rb==0)||(ra==0&&rb==b)){
result[i]="Yes";}else{
result[i]="No";}
ra=0;
rb=0;}for(int i =0; i < result.length; i++){System.out.print(result[i]+"\n");}}}