//Code Author:-code_kika // //Institution:-IIT(BHU) // #include using namespace std; //basic #define pb push_back #define ll long long #define mp make_pair #define fi first #define se second //typedefs #define pii pair #define pll pair #define vpii vector #define vpll vector #define vll vector #define vi vector //functions #define all(c) c.begin(),c.end() #define mini(c) min_element(all(c)) #define maxi(c) max_element(all(c)) #define fill(c,val) memset(c,val,sizeof(c)) //debug #define trace(x) cerr << #x << ": " << x << endl; #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define trace4(a, b, c, d) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl; #define trace5(a, b, c, d, e) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl; #define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl; ll power(ll x, ll y,ll p) { ll res=1; x=x%p; while(y>0) { if(y&1) res=((res%p)*(x%p))%p; y=y>>1; x=((x%p)*(x%p))%p; } return res; } int main(){ ll i,n,z,y,q,b,l,r,a[100005],j; ll mod=1000000007; cin>>n>>z>>y>>q; for(i=0;i>a[i]; } for(i=0;i>b>>l>>r; if(b==1){ a[l]=r; continue; } ll ans=0,x=1; for(j=l;j<=r;j++){ if((j-l)%2==0){ ans=(ans-(x*a[j])%mod)%mod; while(ans<0){ ans+=mod; } } else{ ans=(ans+(x*a[j])%mod)%mod; } x=(((x%mod)*(y%mod))%mod*((power(z,mod-2,mod)%mod)))%mod; //trace2(ans,j); } //trace(ans); if(ans%mod==0){ cout<<"Yes\n"; } else{ cout<<"No\n"; } } }