import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[n];
int[] b = new int[n];
String[] c = new String[n];
int[] k0 = new int[m];
int[] k1 = new int[m];
int[] k2 = new int[m];
int[] arr = new int[m];
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
b[i] = sc.nextInt();
c[i] = sc.next();
}
for (int i = 0; i < m; i++) {
k0[i] = sc.nextInt();
k1[i] = sc.nextInt();
k2[i] = sc.nextInt();
}
int flag = -1, value = -1, judge = -1;
for (int i = 0; i < m; i++) {
int tmp = k0[i] + a[0] * k1[i] + b[0] * k2[i];
if (tmp > 0)
flag = 1;
else
flag = 0;
String str = c[0];
for (int j = 1; j < n; j++) {
int index = k0[i] + a[j] * k1[i] + b[j] * k2[i];
if (index > 0)
value = 1;
else
value = 0;
if ((flag == value && str.equals(c[j])) || ((flag != value) && !str.equals(c[j])))
judge = 0;
else {
judge = 1;
break;
}
}
arr[i] = judge;
judge = -1;
}
for (int i = 0; i < m; i++) {
if (arr[i] == 1)
System.out.println("No");
else
System.out.println("Yes");
}
}
}