#include using namespace std; #define sd(x) scanf("%d", &x) #define boost ios_base::sync_with_stdio(false); #define mp make_pair #define pb push_back #define all(a) a.begin(), a.end() #define f first #define s second // #define TRACE #ifdef TRACE #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; } template void __f(const char* names, Arg1&& arg1, Args&&... args) { const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | "; __f(comma+1, args...); } #else #define trace(...) #endif typedef pair pii; typedef long long ll; typedef vector > matrix; const int mod = 1000000007; const int inf = 50000000; const int maxn = 100010; int n, a, b, c[maxn], pa[maxn], pb[maxn], ma[maxn]; int st[maxn * 5], rem; ll modpow(ll a, ll b) { ll x = 1, y = a; while (b) { if (b & 1) { x = (x * y) % mod; } y = (y * y) % mod; b /= 2; } return x; } int mul(int a, int b) { ll res = a; res *= b; if (res >= mod) { res %= mod; } a = res; return a; } int add(int a, int b) { a = (a + b) % mod; if (a < 0) { a += mod; } return a; } int merge(int r1, int l2, int r2) { int tmp = mul(pb[l2], r1); tmp = mul(tmp, ma[l2]); if (l2 & 1) { tmp *= -1; } return add(r2, tmp); } void init(int s, int e, int k) { if (s == e) { st[k] = mul(c[s], ma[1]); trace(s, e, st[k]); return; } int mid = (s + e) >> 1; int lc = (k << 1) + 1; int rc = lc + 1; init(s, mid, lc); init(mid + 1, e, rc); st[k] = merge(st[lc], e - mid, st[rc]); trace(s, e, st[k]); } void update(int s, int e, int q, int v, int k) { if (s > e || s > q || q > e) { return; } if (s == e) { st[k] = mul(v, ma[1]); return; } int mid = (s + e) >> 1; int lc = (k << 1) + 1; int rc = lc + 1; update(s, mid, q, v, lc); update(mid + 1, e, q, v, rc); st[k] = merge(st[lc], e - mid, st[rc]); } void query(int s, int e, int qs, int qe, int k) { if (s > e || s > qe || qs > e) { return; } if (s >= qs && qe >= e) { rem = merge(rem, e - s + 1, st[k]); trace(s, e, st[k], rem); return; } int mid = (s + e) >> 1; int lc = (k << 1) + 1; int rc = lc + 1; query(s, mid, qs, qe, lc); query(mid + 1, e, qs, qe, rc); } int main() { // freopen("i.txt", "r", stdin); // freopen("o.txt", "w", stdout); int t, q, idx, l, r, x; scanf("%d %d %d %d", &n, &a, &b, &q); pa[0] = pb[0] = ma[0] = 1; for (int i = 1; i < maxn; i++) { pa[i] = mul(pa[i - 1], a); pb[i] = mul(pb[i - 1], b); ma[i] = modpow(pa[i], mod - 2); } for (int i = 1; i <= n; i++) { scanf("%d", &c[i]); } reverse(c + 1, c + n + 1); init(1, n, 0); while (q--) { scanf("%d", &t); if (t == 1) { scanf("%d %d", &idx, &x); idx += 1; idx = n - idx + 1; update(1, n, idx, x, 0); } else { scanf("%d %d", &l, &r); l += 1; r += 1; l = n - l + 1; r = n - r + 1; rem = 0; trace(l, r); /*if (l == r || b == 0) { printf("No\n"); continue; }*/ query(1, n, r, l, 0); trace(rem); if (rem == 0) { printf("Yes\n"); } else { printf("No\n"); } } } return 0; }