#include using namespace std; typedef long long ll; #define mod 1000000007 ll sum[400010]; ll power(ll x, int y){ if(y==0) return 1; ll temp = power(x,y/2)%mod; if(y%2==0) return (temp*temp)%mod; return (x*((temp*temp)%mod))%mod; } ll powerdiv(ll b,ll a,int n){ return (power(b,n)*power(a,n))%mod; } ll powerab[100001]; void build(int node,ll c[],int start,int end,ll a,ll b){ if(start==end){ sum[node] = c[start]; } else{ int mid=(start+end)/2; build(2*node,c,start,mid,a,b); build(2*node+1,c,mid+1,end,a,b); sum[node] = (sum[2*node]+ ((mid-start+1)%2==0?1:-1)*(powerdiv(b,a,mid-start+1)*sum[2*node+1])%mod)%mod; sum[node] = (sum[node]+mod)%mod; } } void update(int node,ll c[],int start,int end,int idx,ll val,ll a, ll b){ if(start==end){ c[idx]=val; sum[node] = c[idx]; } else{ int mid=(start+end)/2; if(start<=idx&&idx<=mid){ update(2*node,c,start,mid,idx,val,a,b); } else{ update(2*node+1,c,mid+1,end,idx,val,a,b); } sum[node] = (sum[2*node]+ ((mid-start+1)%2==0?1:-1)*(powerdiv(b,a,mid-start+1)*sum[2*node+1])%mod)%mod; sum[node] = (sum[node]+mod)%mod; } } ll query(int node,int start,int end,int l,int r,ll a,ll b){ if(r> n >> a >> b >> q; ll c[n+1]; for(int c_i = 1; c_i <= n; c_i++){ cin >> c[c_i]; } ll x = power(a,mod-2); build(1,c,1,n,x,b); while(q--){ int queryType,first,second; cin >> queryType >> first >> second; if(queryType == 1){ update(1,c,1,n,first+1,second,x,b); } else{ if(query(1,1,n,first+1,second+1,x,b)%mod==0){ cout<<"Yes\n"; } else{ cout<<"No\n"; } } } return 0; }