#include #define all(a) (a).begin(), (a).end() #define sz(a) (int)(a).size() #define pb push_back using namespace std; typedef long long ll; typedef pair pii; typedef long double ld; const int mod = 1e9 + 7; const int nmax = 100500; void add(int& a, int b) { a += b; if (a >= mod) { a -= mod; } } void mul(int& a, int b) { ll c = ll(a) * ll(b); if (c >= mod) { c %= mod; } a = c; } void sub(int& a, int b) { a -= b; if (a < 0) { a += mod; } } int binpow(int a, int n) { int ans = 1; while (n) { if (n & 1) { mul(ans, a); } n >>= 1; mul(a, a); } return ans; } int alpha; vector t; vector degs(nmax); void unite(int v, int tl, int tr) { int tm = (tl + tr) >> 1; t[v] = t[v * 2 + 1]; mul(t[v], degs[tm - tl + 1]); add(t[v], t[v * 2]); } void build(int v, int tl, int tr, vector& c) { if (tl == tr) { t[v] = c[tl]; return; } int tm = (tl + tr) >> 1; build(v * 2, tl, tm, c); build(v * 2 + 1, tm + 1, tr, c); unite(v, tl, tr); } void update(int v, int tl, int tr, int pos, int val) { if (tl == tr) { t[v] = val; return; } int tm = (tl + tr) >> 1; if (pos <= tm) { update(v * 2, tl, tm, pos, val); } else { update(v * 2 + 1, tm + 1, tr, pos, val); } unite(v, tl, tr); } int get(int v, int tl, int tr, int l, int r) { if (tl == l && tr == r) { return t[v]; } int tm = (tl + tr) >> 1; if (r <= tm) { return get(v * 2, tl, tm, l, r); } if (l > tm) { return get(v * 2 + 1, tm + 1, tr, l, r); } int ans1 = get(v * 2, tl, tm, l, tm); int ans2 = get(v * 2 + 1, tm + 1, tr, tm + 1, r); mul(ans2, degs[tm - l + 1]); add(ans1, ans2); return ans1; } int main() { //ifstream cin("input.txt"); //ofstream cout("output.txt"); ios_base::sync_with_stdio(false); cin.tie(0); int n, a, b, q; cin >> n >> a >> b >> q; mul(b, binpow(a, mod - 2)); b = (mod - b) % mod; alpha = b; t.resize(4 * n); degs[0] = 1; for (int i = 1; i < nmax; ++i) { degs[i] = degs[i - 1]; mul(degs[i], alpha); } vector c(n); for (int i = 0; i < n; ++i) { cin >> c[i]; } build(1, 0, n - 1, c); while (q--) { int type; cin >> type; if (type == 1) { int pos, val; cin >> pos >> val; update(1, 0, n - 1, pos, val); } else { int l, r; cin >> l >> r; int x = get(1, 0, n - 1, l, r); cout << (x == 0 ? "Yes\n" : "No\n"); } } }