#include #include #include #include #define forn(i, n) for(int i = 0; i < (int)n; i++) #define C 100000 #define M 1000000007 using namespace std; int t[600000], sz; // a*s+b*t=d int xgcd(int a, int b, int &s, int &t) { if(!b) { s = 1; t = 0; return a; } int d = xgcd(b, a % b, t, s); t -= s * (a / b); return d; } unsigned int inv(unsigned int x) { int s, t; xgcd(x, M, s, t); while(s < 0) s += M; return s; } int get_sum_aux(int i, int j, int l, int r, int k) { if(l >= i && r <= j) return t[k]; if(l >= j || r <= i) return 0; return (get_sum_aux(i, j, l, (l + r) / 2, 2 * k) + get_sum_aux(i, j, (l + r) / 2, r, 2 * k + 1)) % M; } int get_sum(int i, int j) { return get_sum_aux(i, j, 0, sz, 1); } void update(int i, int x) { t[sz + i] = x; int p = sz + i; while(p > 1) { p /= 2; t[p] = (t[2 * p] + t[2 * p + 1]) % M; } } int main() { int n, a, b, q; cin >> n >> a >> b >> q; vector c(n); int z = ((1L * M - b) * inv(a)) % M; forn(i, n) cin >> c[i]; sz = 1; while(sz < n) sz *= 2; forn(j, 2 * sz) t[j] = 0; vector p; p.push_back(1); forn(i, n) { update(i, (p[i] * c[i]) % M); p.push_back((p[i] * z) % M); } forn(i, q) { int tt, ll, rr; cin >> tt >> ll >> rr; if(tt == 1) { update(ll, (rr * p[ll]) % M); c[ll] = rr; } else { if(z == 0) { cout << (c[ll]? "No": "Yes") << endl; } else { //cerr << ll << " " << rr << " " << get_sum(ll, rr + 1) << endl; cout << (get_sum(ll, rr + 1)? "No": "Yes") << endl; } } } }