#!/bin/python3 import sys # https://en.wikibooks.org/wiki/Algorithm_Implementation/Mathematics/Extended_Euclidean_algorithm#Modular_inverse def xgcd(b, n): x0, x1, y0, y1 = 1, 0, 0, 1 while n != 0: q, b, n = b // n, n, b % n x0, x1 = x1, x0 - q * x1 y0, y1 = y1, y0 - q*y1 return b, x0, y0 def mulinv(b, n): g, x, _ = xgcd(b, n) if g == 1: return x % n def check(cs, a, ainv, b, binv): if b == 0: if a == 0: return all(c == 0 for c in cs) return cs[0] == 0 else: r = 0 for i, c in enumerate(cs): r = ((c-a*r)*binv) % M return r == 0 n,a,b,q = input().strip().split(' ') n,a,b,q = [int(n),int(a),int(b),int(q)] M = 10**9+7 ainv = mulinv(a, M) binv = mulinv(b, M) cs = list(map(int, input().strip().split(' '))) for a0 in range(q): queryType,first,second = input().strip().split(' ') queryType,first,second = [int(queryType),int(first),int(second)] if queryType == 1: cs[first] = second if queryType == 2: if check(cs[first:second+1], a, ainv, b, binv): print('Yes') else: print('No')