#include #define F first #define S second #define llong long long #define ullong unsigned long long #define mp make_pair #define pb push_back #define pii pair #define sz(v) (int)v.size() #define pt pair #define x first #define y second using namespace std; const int MXN = (int)3e6 + 10; const int INF = (int)1e9 + 7; const llong LINF = (llong)1e18 + 10; const double EPS = (double)1e-6; const double PI = (double)acos(-1.0); int n, a, b, q; int c[MXN]; int rt; int rt1; int pp[MXN]; int t[MXN]; int binpow(int x, int y){ int ret = 1; while(y){ if(y & 1) ret = (ret * 1LL * x) % INF; x = (x * 1LL * x) % INF; y >>= 1; } ret %= INF; ret += INF; ret %= INF; return ret; } int add(int x, int y){ x = (x + 0LL + y) % INF; if(x < 0) x += INF; return x; } void build(int v = 1, int tl = 0, int tr = n - 1){ if(tl == tr){ t[v] = (c[tl] * 1LL * pp[tl]) % INF; return; } int tm = (tl + tr) / 2; build(v + v, tl, tm); build(v + v + 1, tm + 1, tr); t[v] = add(t[v + v], t[v + v + 1]); } void upd(int pos, int val, int v = 1, int tl = 0, int tr = n - 1){ if(tl == tr) t[v] = (val * 1LL * pp[tl]) % INF; else { int tm = (tl + tr) / 2; if(pos <= tm) upd(pos, val, v + v, tl, tm); else upd(pos, val, v + v + 1, tm + 1, tr); t[v] = add(t[v + v], t[v + v + 1]); } } int sum(int l, int r, int v = 1, int tl = 0, int tr = n - 1){ if(tr < l || tl > r) return 0; if(l <= tl && tr <= r) return t[v]; int tm = (tl + tr) / 2; return add(sum(l, r, v + v, tl, tm), sum(l, r, v + v + 1, tm + 1, tr)); } int main(){ #ifdef LOCAL freopen("input.txt", "r", stdin); #endif scanf("%d%d%d%d", &n, &a, &b, &q); for(int i = 0; i < n; ++i){ scanf("%d", &c[i]); } rt = (b * 1LL * binpow(a, INF - 2)) % INF; rt1 = INF - rt; pp[0] = 1; for(int i = 1; i < n; ++i){ pp[i] = (pp[i - 1] * 1LL * rt1) % INF; } build(); int tmp; while(q--){ int type, l, r; scanf("%d%d%d", &type, &l, &r); if(type == 1){ upd(l, r); } else { tmp = sum(l, r); tmp = (tmp * 1LL * binpow(pp[l], INF - 2)) % INF; printf("%s\n", (tmp % INF == 0) ? "Yes" : "No"); } } return 0; }