import java.io.*; import java.util.Vector; public class LuckyNumber8 { static long p = 1000000000+7; public static void main(String args[])throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); String ss[] = s.split(" "); int n = Integer.parseInt(ss[0]); int a = Integer.parseInt(ss[1]); int b = Integer.parseInt(ss[1]); int q = Integer.parseInt(ss[1]); s = br.readLine(); int arr[]; arr = new int[n]; for(int i=0;i=0){ s = br.readLine(); ss = s.split(" "); if(Integer.parseInt(ss[0])==1){ arr[Integer.parseInt(ss[1])]=Integer.parseInt(ss[2]); } else{ int count=0; int l = Integer.parseInt(ss[1]); int r = Integer.parseInt(ss[2]); for(int i=0;i<100000;i++){ long num=0; for(int j=l;j<=r;j++) { int x=i; if(j==0)x=1; num+=arr[j]*power(i,j)*x; } long qx = a*i+b; if(num%qx==0)count++; } if(count>1) System.out.println("YES"); else System.out.print("NO"); } q--; } } static long power(int x, int y) { if( y == 0) return 1; else if (y%2 == 0) return (power(x, y/2)*power(x, y/2))%p; else return (x*power(x, y/2)*power(x, y/2))%p; } }