#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; // To find GCD of a and b long long gcd(long long a, long long b); // To compute x raised to power y under modulo m long long power(long long x, unsigned long long y, unsigned long long m); // Function to find modular inverse of a under modulo m // Assumption: m is prime long long modInverse(long long a, long long m) { return power(a, m-2, m); } // To compute x^y under modulo m long long power(long long x, unsigned long long y, unsigned long long m) { if (y == 0) return 1; long long p = power(x, y/2, m) % m; p = (p * p) % m; return (y%2 == 0)? p : (x * p) % m; } // Function to return gcd of a and b long long gcd(long long a, long long b) { if (a == 0) return b; return gcd(b%a, a); } typedef long long ll; #define mod 1000000007 // Driver Program long long pow_mod(long long a,long long b,long long m) { long long x=1,y=a; while(b>0) { if(b & 1) x=(x*y)%m; y=(y*y)%m; b>>=1; } return x; } int main(){ long long n; long long a; long long b; long long q; cin >> n >> a >> b >> q; vector c(n); for(long long c_i = 0; c_i < n; c_i++){ cin >> c[c_i]; } ll d=modInverse(a,mod); ll t=-1*b; while(t<0){ t+=1000000007; } t=(d*t)%1000000007; for(long long a0 = 0; a0 < q; a0++){ long long queryType; long long first; long long second; cin >> queryType >> first >> second; ll i,j; switch(queryType){ case 1:c[first]=second; break; case 2: ll ans=0; for(i=first,j=0;i<=second;i++,j++){ ll tq=pow_mod(t,j,mod); tq=tq%mod; ll sum=(c[i]*tq)%mod; ans+=sum; ans%=mod; //yeah } if(ans==0){ cout<<"Yes"<