#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; // C function for extended Euclidean Algorithm long gcdExtended(long a, long b, long *x, long *y) { // Base Case if (a == 0) { *x = 0, *y = 1; return b; } long x1, y1; // To store results of recursive call long gcd = gcdExtended(b%a, a, &x1, &y1); // Update x and y using results of recursive // call *x = y1 - (b/a) * x1; *y = x1; return gcd; } long modInverse(int a, int m) { long x, y; long g = gcdExtended(a, m, &x, &y); // m is added to handle negative x return (x%m + m) % m; } int main(){ int n; int a; int b; int q; cin >> n >> a >> b >> q; vector c(n); for(int c_i = 0; c_i < n; c_i++){ cin >> c[c_i]; } for(int a0 = 0; a0 < q; a0++){ int queryType; int first; int second; cin >> queryType >> first >> second; if(queryType==1) { c[first]=second; } else { long ai=modInverse(a,1000000007); long temp=c[second]; for(int i=second-1;i>=first;i--) { temp=(1000000007+c[i]-(temp*ai*b)%1000000007)%1000000007; } if(temp==0) cout<<"Yes"<