#include using namespace std; #define gc getchar unlocked #ifndef ONLINE JUDGE #define gc getchar #endif // ONLINE JUDGE #define pc putchar_unlocked #ifndef ONLINE JUDGE #define pc putchar #endif // ONLINE JUDGE #define fRead freopen("input.txt","r",stdin) #define fWrite freopen ("output.txt","w",stdout) #define eps 1e-8 #define inf 0x3f3f3f3f #define INF 2e18 #define LL long long #define ULL unsigned long long #define PI acos(-1.0) #define pb push_back #define mk make_pair #define pii pair #define pLL pair #define ff first #define ss second #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define SQR(a) ((a)*(a)) #define Unique(a) sort(all(a)),a.erase(unique(all(a)),a.end()) #define min3(a,b,c) min(a,min(b,c)) #define max3(a,b,c) max(a,max(b,c)) #define min4(a,b,c,d) min(min(a,b),min(c,d)) #define max4(a,b,c,d) max(max(a,b),max(c,d)) #define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e)) #define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e)) #define Iterator(a) __typeof__(a.begin()) #define rIterator(a) __typeof__(a.rbegin()) #define FOR(a,it) for(Iterator(a) it = a.begin();it != a.end(); it++) #define rFOR(a,it) for(rIterator(a) it = a.rbegin();it != a.rend(); it++) #define FastRead ios_base::sync_with_stdio(0);cin.tie(0) #define CasePrint pc('C'); pc('a'); pc('s'); pc('e'); pc(' '); write(qq++,false); pc(':'); pc(' ') #define vi vector #define vL vector #define For(I,A,B) for(int I = (A); I < (B); ++I) #define rFor(I,A,B) for(int I = (A); I >= (B); --I) #define Rep(I,N) For(I,0,N) #define REP(I,N) For(I, 1, N + 1) using namespace std; const int MOD = 1e9 + 7; int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0}; int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0}; template inline T GCD (T a,T b ) {a = abs(a);b = abs(b); if(a < b) swap(a, b); while ( b ) { a = a % b; swap ( a, b ); } return a;} template inline T EGCD(T a,T b,T &x,T &y){if(a == 0) {x = 0;y = 1;return b;}T x1, y1;T d = EGCD(b % a, a, x1, y1);x = y1 - (b / a) * x1;y = x1;return d;} template inline T LCM(T x,T y){T tp = GCD(x,y);if( (x / tp) * 1. * y > 9e18) return 9e18;return (x / tp) * y;} template inline T BigMod(T A,T B,T M = MOD){T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;} template inline T InvMod (T A,T M = MOD){return BigMod(A,M-2,M);} /*---------------------------fast I/O------------------------------------*/ #define scani2(a,b) scani(a) , scani(b) #define scani3(a,b,c) scani(a), scani(b), scani(c) #define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d) #define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e) template T scani(T &n){n = 0;bool negative = false;char c = gc();while( c < '0' || c > '9'){if(c == '-') negative = true;c = gc();}while(c >= '0' && c <= '9'){n = n*10 + c-48;c = gc();}if(negative) n = ~(n-1);return n;} template void write(T n,int type = true){if(n<0) {pc('-');n = -n;}if(!n) {pc('0');if(type==32) pc(' '); else if(type) pc('\n'); return;}char buff[22];int len = 0;while(n) buff[len++] = n%10+48,n/=10;for(int i=len-1;i>=0;i--) pc(buff[i]);if(type==32) pc(' '); else if(type) pc('\n');} int scans(char *a){int i=0;char c = 0;while(c < 33) c = gc();while(c > 33){a[i++] = c;c = gc();}a[i] = 0;return i;} /*********************************************** End of template *********************************************/ const int N = 200005; const int M = 555; LL Tree[N << 2]; LL A, B, D; LL in[N]; int n; void built(int node, int b, int e) { if(b == e) { Tree[node] = (BigMod(D, b - 1LL) * in[b]) % MOD; return ; } int mid = b + e >> 1; int lf = node << 1; int rt = lf | 1; built(lf, b, mid); built(rt, mid + 1, e); Tree[node] = Tree[lf] + Tree[rt]; } void update(int node, int b, int e, int i) { if(b == e) { Tree[node] = (BigMod(D, b - 1LL) * in[b]) % MOD; return ; } int mid = b + e >> 1; int lf = node << 1; int rt = lf | 1; if(i <= mid) update(lf, b, mid, i); else update(rt, mid + 1, e, i); Tree[node] = Tree[lf] + Tree[rt]; Tree[node] %= MOD; } LL query(int node, int b, int e, int i, int j) { if(b > j || e < i) return 0; if(b >= i && e <= j) Tree[node]; int mid = b + e; int lf = node << 1; int rt = lf | 1; return (query(lf, b, mid, i, j) + query(rt, mid + 1, e, i, j)) % MOD; } int main() { int qr; cin >> n >> A >> B >> qr; B = InvMod(B); D = (A * B) % MOD; for(int i=1;i<=n;i++) cin >> in[i]; built(1, 1, n); while(qr--){ LL x, y, ck; cin >> ck >> x >> y; if(ck == 1) { in[x] = y; update(1, 1, n, x); } else { LL ans = query(1, 1, n, x, y); LL vg = BigMod(D, x - 1); vg = InvMod(vg); ans = ans * vg; ans %= MOD; if(ans != 0) puts("NO"); else puts("YES"); } } }