#include #ifndef M_PI #define M_PI 3.14159265358979323846264338327 #endif // M_PI #define endl "\n" #define S struct #define X first #define Y second #define V vector #ifndef __linux__ #define LLD "%I64d" #else #define LLD "%ll""d" #endif #define FOR(x, y, z) for (int x = (y); x < (z); ++x) #define FORR(x, y, z) for (int x = (y); x > (z); --x) #define GET(a, n) for (int __i = 0; __i < (n); ++__i) cin >> a[__i]; #define GETM(a, n, m) for (int __i = 0; __i < (n); ++__i) for (int __j = 0; __j < m; ++__j) cin >> a[__i][__j]; #define PRINTM(a, n, m) for (int __i = 0; __i < (n); ++__i) { for (int __j = 0; __j < m; ++__j) cout << a[__i][__j] << " "; cout << endl; }; #define PRINT(a, n) for (int __i = 0; __i < (n); ++__i) cout << a[__i] << " "; #define IT(a) a.begin(), a.end() #define SQR(x) (x) * (x) #define CASE(a, s) cout << "Case #" << a << ": " << s << endl; #define DEB(a) cout << #a << " = " << (a) << endl; cout.flush(); #define DEBA(a) for (auto __i: a) cout << __i << " "; cout << endl; cout.flush(); #define IFDEB(b, a) if (b) { cout << #a << " = " << (a) << endl; cout.flush(); } using namespace std; typedef long long LL; typedef long double LD; typedef unsigned long long ULL; typedef pair PII; typedef pair PLL; const int MOD = 1000000007; void sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } S Sync_stdio { Sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } } _sync_stdio; S FAIL { FAIL () { cout << "CHANGE!!!" << endl;}}; int gcd_ext(int a, int b, int &x, int &y) { if (a == 0) { x = 0; y = 1; return b; } int x1, y1; int d = gcd_ext(b % a, a, x1, y1); x = y1 - (b / a) * x1; y = x1; return d; } LL inv(LL t, LL mod) { if (t == 0) { return 0; } int x; int y; gcd_ext(t, mod, x, y); return (x % mod + mod) % mod; } vector p; template class SegmentTree { int maxn = 1000000; vector t; void build(const vector &a, int v, int tl, int tr) { if (tl == tr) { t[v] = a[tl]; } else { int tm = (tl + tr) / 2; build (a, v * 2 + 1, tl, tm); build (a, v * 2 + 2, tm + 1, tr); t[v] = (t[v * 2 + 1] + t[v * 2 + 2]) % MOD; } } T sum(int v, int tl, int tr, int l, int r) { if (l > r) { return 0; } if (l == tl && r == tr) { return t[v]; } int tm = (tl + tr) / 2; return (sum(v * 2 + 1, tl, tm, l, min(r, tm)) + sum (v * 2 + 2, tm + 1, tr, max(l, tm + 1), r)) % MOD; } void update(int v, int tl, int tr, int pos, T new_val) { if (tl == tr) { t[v] = new_val; } else { int tm = (tl + tr) / 2; if (pos <= tm) { update (v * 2 + 1, tl, tm, pos, new_val); } else { update (v * 2 + 2, tm + 1, tr, pos, new_val); } t[v] = (t[v * 2 + 1] + t[v * 2 + 2]) % MOD; } } public: SegmentTree (int n) { maxn = n; t.resize(4 * maxn); } SegmentTree (const vector &a) { maxn = a.size(); t.resize(4 * maxn); build(a, 0, 0, maxn - 1); } void update(int pos, T add) { update(0, 0, maxn - 1, pos, add); } T sum(int l, int r) { return sum(0, 0, maxn - 1, l, r); } }; int main() { int n, a, b, q; cin >> n >> a >> b >> q; vector c(n); GET(c, n); vector w = c; LL val = b * inv(a, MOD) % MOD; val = -val; val += MOD; val %= MOD; p.resize(n + 1); p[0] = 1; FOR (i, 1, n + 1) { p[i] = p[i - 1] * val % MOD; } FOR (i, 0, n) { c[i] = c[i] * p[i] % MOD; } SegmentTree tree(c); FOR (i, 0, q) { int t, l, r; cin >> t >> l >> r; if (t == 1) { tree.update(l, p[l] * r % MOD); w[l] = r; } else { if (val == 0) { cout << (w[l] == 0 ? "Yes" : "No") << endl; continue; } LL res = tree.sum(l, r); cout << (res % MOD == 0 ? "Yes" : "No") << endl; } } return 0; }