#include #include #include #include #include #define ll long long using namespace std; const long long p = 1000000007; #include using namespace std; class Fenwick_Tree_Sum { public: vector tree; Fenwick_Tree_Sum(const vector& Arg) { tree.resize(Arg.size()); for(int i = 0 ; i=0) { sum = (sum+tree[ind])%p; ind &= ind + 1; ind--; } return sum; } }; long long ppow(long long a, long long n){ if(n==1){ return a; } if(n%2==0){ return ppow((a*a)%p,n/2)%p; } else{ return (a*ppow(a,n-1))%p; } } int main() { ll n, Q, a, b, x; cin >> n >> a >> b >> Q; x = ((-b*ppow(a,p-2))%p+p)%p; vector C(n), X(n), X1(n); X[0]=1; X1[0]=1; cin >> C[0]; for(int i=1; i> C[i]; C[i] %= p; X[i]=(X[i-1]*x)%p; if(x!=0) C[i]=(X[i]*C[i])%p; X1[i]=ppow(X[i],p-2); } Fenwick_Tree_Sum F(C); long long i,j; for(int q=0; q> i; if(i==1){ cin >> i >> j; j=((j*X[i]-C[i])%p+p)%p; F.increase(i,j); } else{ cin >> i >> j; if(x==0) cout << ((C[i])?"No":"Yes") << endl; else{ j=F.getsum(i,j); cout << (((j*X1[i])%p)?"No":"Yes") << endl; } } } return 0; }