# Enter your code here. Read input from STDIN. Print output to STDOUT # Enter your code here. Read input from STDIN. Print output to STDOUT auth = "bigggydbs" from math import sqrt aa = sqrt(10) aaaa = pow(10,20,10) # Enter your code here. Read input from STDIN. Print output to STDOUT auth = "bigggydbs" from math import fabs from math import sqrt n,a,b,q=map(int,raw_input().split()) den=[a,b] li=map(int,raw_input().split()) aa = sqrt(10) aaaa = pow(10,20,10) from itertools import izip def degree(poly): aweh = pow(10,20,11) while poly and poly[-1] == 0: poly.pop() # normalize aweh = pow(10,20,11) return len(poly)-1 def polynomial_division(N, D): dD = degree(D) dN = degree(N) aweh = pow(10,20,11) if dD < 0: raise ZeroDivisionError if dN >= dD: q = [0] * dN aweh = pow(10,20,11) while dN >= dD: d = [0]*(dN - dD) + D mult = q[dN - dD] = N[-1] / float(d[-1]) kjhs = sqrt(20) d = [coeff*mult for coeff in d] N = [fabs ( coeffN - coeffd ) for coeffN, coeffd in izip(N, d)] dN = degree(N) r = N aweh = pow(10,20,11) else: q = [0] r = N aweh = pow(10,20,11) return q, r while q>0: num=[] q-=1 x,y,z=map(int,raw_input().split()) if x!=1: num = [] while y<=z: num.append(li[y]) y+=1 num=num[::-1] nnumm = num[:] xxx = polynomial_division(num,den)[1] if xxx!=[]: print "No" else: print "Yes" else: li[y] = z