#include using namespace std; #define pb push_back #define m_p make_pair #define F first #define S second #define For(i,a,b) for(int i=a;ib;i--) #define rFore(i,a,b) for(int i=a;i>=b;i--) #define tr(it,a) for(__typeof((a).begin()) it=(a).begin();it!=(a).end();it++) #define all(a) a.begin(),a.end() #define mem(a,b) memset(a,b,sizeof(a)) typedef long long int lli; typedef pair pii; typedef pair pi3; typedef pair pi4; typedef vector vi; typedef vector vpii; void sc(int& a){scanf("%d",&a);} void sc(lli& a){scanf("%lld",&a);} void sc(int& a,int& b){sc(a);sc(b);} void sc(lli& a,lli& b){sc(a);sc(b);} void sc(int& a,int& b,int& c){sc(a,b);sc(c);} void sc(lli& a,lli& b,lli& c){sc(a,b);sc(c);} void prl(int a){printf("%d\n",a);} void prl(lli a){printf("%lld\n",a);} void prl(){printf("\n");} void prs(int a){printf("%d ",a);} void prs(lli a){printf("%lld ",a);} void prl(lli a, lli b){cout<0){if(b&1)res=(res*a)%mod;a=(a*a)%mod;b=b/2;}return res%mod;} lli pow(lli a, lli b){lli res=1;while(b>0){if(b&1)res=(res*a);a=(a*a);b=b/2;}return res;} lli modulo(lli a,lli b){ lli c = a%b; return c; } lli modInverse(lli a, lli m) { lli m0 = m, t, q; lli x0 = 0, x1 = 1; if (m == 1) return 0; while (a > 1) { // q is quotient q = a / m; t = m; // m is remainder now, process same as // Euclid's algo m = a % m, a = t; t = x0; x0 = x1 - q * x0; x1 = t; } // Make x1 positive if (x1 < 0) x1 += m0; return x1; } int modI[100000]; #define inf INT_MAX #define linf LLONG_MAX const lli MAX = 1000005; #define N 100000+5 #define BLOCK_SIZE 320 lli max(lli a, lli b) { return (a > b)? a : b; } typedef pair Key; lli gcd ( lli a, lli b ) { lli c; while ( a != 0 ) { c = a; a = b%a; b = c; } return b; } /* Recursive Standard C Function: Greatest Common Divisor */ lli gcdr ( lli a, lli b ) { if ( a==0 ) return b; return gcdr ( b%a, a ); } int phi(int n) { int result = n; // Initialize result as n // Consider all prime factors of n and subtract their // multiples from result for (int p=2; p*p<=n; ++p) { // Check if p is a prime factor. if (n % p == 0) { // If yes, then update n and result while (n % p == 0) n /= p; result -= result / p; } } // If n has a prime factor greater than sqrt(n) // (There can be at-most one such prime factor) if (n > 1) result -= result / n; return result; } int C[1000005]; int main() { lli n,a,b,q; sc(n,a); sc(b,q); b=mod-b; a=modInverse(a,mod); a=(a*b)%mod; lli p; For(i,0,n){ sc(C[i]); } int k,x,y; lli ans; while(q--){ sc(k); if(k==1){ sc(x,y); C[x]=y; } else{ sc(x,y); ans=C[x]; p=a; For(i,x+1,y+1){ ans=(ans+(C[i]*p)%mod)%mod; p=(p*a)%mod; } if(ans==0) printf("Yes\n"); else printf("No\n"); } } return 0; }