import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.math.BigInteger; import java.util.Locale; import java.util.StringTokenizer; public class Solution implements Runnable { public static final int MOD = 1000000007; public static final BigInteger BMOD = BigInteger.valueOf(MOD); private PrintStream out; private BufferedReader in; private StringTokenizer st; public void solve() throws IOException { int n = nextInt(); int a = nextInt(); int b = nextInt(); int q = nextInt(); int[] c = new int[n]; for (int i = 0; i < n; i++) { c[i] = nextInt(); } int[] qt = new int[q]; int[] qa1 = new int[q]; int[] qa2 = new int[q]; for (int i = 0; i < q; i++) { qt[i] = nextInt(); qa1[i] = nextInt(); qa2[i] = nextInt(); } boolean[] answer = solve(n, a, b, c, q, qt, qa1, qa2); for (int i = 0; i < answer.length; i++) { if (answer[i]) { out.println("Yes"); } else { out.println("No"); } } } private boolean[] solve(int n, int a, int b, int[] c, int q, int[] qt, int[] qa1, int[] qa2) { int cnt2 = 0; for (int i = 0; i < q; i++) { if (qt[i] == 2) { cnt2++; } } boolean[] result = new boolean[cnt2]; if (b == 0) { solveZero(n, c, q, qt, qa1, qa2, result); } else { solveNormal(n, a, b, c, q, qt, qa1, qa2, result); } return result; } private void solveNormal(int n, int a, int b, int[] c, int q, int[] qt, int[] qa1, int[] qa2, boolean[] result) { int x = (MOD - BigInteger.valueOf(b).multiply(BigInteger.valueOf(a).modInverse(BMOD)).mod(BMOD).intValue()) % MOD; // int xi = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b).modInverse(BMOD)).mod(BMOD).intValue(); int[] xp = new int[n]; // int[] xip = new int[n]; xp[0] = 1; // xip[0] = 1; for (int i = 1; i < n; i++) { xp[i] = (int) ((1L * xp[i - 1] * x) % MOD); // xip[i] = (int) ((1L * xip[i - 1] * xi) % MOD); } SegTree seg = new SegTree(n); for (int i = 0; i < n; i++) { seg.set(i, (int) ((1L * c[i] * xp[i]) % MOD)); } int done = 0; for (int i = 0; i < q; i++) { if (qt[i] == 1) { seg.set(qa1[i], (int) ((1L * qa2[i] * xp[qa1[i]]) % MOD)); } else { int sum = seg.get(qa1[i], qa2[i]); result[done++] = sum == 0; } } if (done != result.length) { throw new RuntimeException("I'm a stupid idiot11"); } } private void solveZero(int n, int[] c, int q, int[] qt, int[] qa1, int[] qa2, boolean[] result) { int done = 0; for (int i = 0; i < q; i++) { if (qt[i] == 1) { c[qa1[i]] = qa2[i]; } else { result[done++] = c[qa1[i]] == 0; } } if (done != result.length) { throw new RuntimeException("I'm a stupid idiot11"); } } public static class SegTree { private int base; private int[] a; public SegTree(int n) { base = 1; while (base < n) { base *= 2; } a = new int[base + n + n % 2]; } public void set(int i, int v) { i = base + i; a[i] = v; for (int j = i / 2; j != 0; j /= 2) { a[j] = (a[2 * j] + a[2 * j + 1]) % MOD; } } public int get(int l, int r) { l = base + l; r = base + r; if (l == r) { return a[l]; } int sum = (a[l] + a[r]) % MOD; while (l + 1 != r) { if (l % 2 == 0) { sum = (sum + a[l + 1]) % MOD; } if (r % 2 == 1) { sum = (sum + a[r - 1]) % MOD; } l /= 2; r /= 2; } return sum; } } public double nextDouble() throws IOException { return Double.parseDouble(next()); } public long nextLong() throws IOException { return Long.parseLong(next()); } public int nextInt() throws IOException { return Integer.parseInt(next()); } public String next() throws IOException { while (!st.hasMoreTokens()) { String line = in.readLine(); if (line == null) { return null; } st = new StringTokenizer(line); } return st.nextToken(); } @Override public void run() { try { solve(); out.close(); } catch (Throwable e) { throw new RuntimeException(e); } } public Solution(String name) throws IOException { Locale.setDefault(Locale.US); if (name == null) { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintStream(new BufferedOutputStream(System.out)); } else { in = new BufferedReader(new InputStreamReader(new FileInputStream(name + ".in"))); out = new PrintStream(new BufferedOutputStream(new FileOutputStream(name + ".out"))); } st = new StringTokenizer(""); } public static void main(String[] args) throws IOException { new Thread(new Solution(null)).start(); } }