#!/bin/python from copy import deepcopy def normalize(poly): while poly and poly[-1] == 0: poly.pop() if poly == []: poly.append(0) def poly_divmod(num, den): num = num[:] normalize(num) den = den[:] normalize(den) if len(num) >= len(den): shiftlen = len(num) - len(den) den = [0] * shiftlen + den else: return [0], num quot = [] divisor = float(den[-1]) for i in xrange(shiftlen + 1): mult = num[-1] / divisor quot = [mult] + quot if mult != 0: d = [mult * u for u in den] num = [u - v for u, v in zip(num, d)] num.pop() den.pop(0) normalize(num) return quot, num n,a,b,q = raw_input().strip().split(' ') n,a,b,q = [int(n),int(a),int(b),int(q)] c = map(int, raw_input().strip().split(' ')) for a0 in xrange(q): queryType,first,second = raw_input().strip().split(' ') queryType,first,second = [int(queryType),int(first),int(second)] if queryType == 1: c[first] = second else: temp = deepcopy(c[first:second+1]) temp.reverse() q,r = poly_divmod(temp,[b,a]) if r==[0]: print "Yes" else: print "No"