#include using namespace std; #define MOD 1000000007 #define X first #define Y second #define MAX 100045 #define sc scanf #define pf printf #define pb push_back #define pff push_front #define mp make_pair #define ll long long #define iosbase ios_base::sync_with_stdio(false) #define dbg(x) cout<<#x<<"="<>=1; a=(a*a)%cc; } return res%cc; } ll combine( ll a,ll b) { return (a+b)%MOD; } void build_tree(ll node,ll l,ll r) { if(l>r) return; if(l==r) { tree[node]=ans[l]; return; } ll md=(l+r)>>1; build_tree(node*2,l,md); build_tree(node*2+1,md+1,r); tree[node]=combine(tree[node*2],tree[node*2+1]); } void update(ll node,ll l,ll r,ll s,ll e,ll val) { if(l>r || l>e || r>1; update(node*2,l,md,s,e,val); update(node*2+1,md+1,r,s,e,val); tree[node]=combine(tree[node*2],tree[node*2+1]); } ll query(ll node,ll l,ll r,ll s,ll e) { if(l>r || er) return 0; if(s<=l && r<=e) return tree[node]; ll md=(l+r)>>1; ll one=query(node*2,l,md,s,e); ll to=query(node*2+1,md+1,r,s,e); return combine(one,to); } int main() { ll n,a,b,x,y,type,l,r,q,t,temp; cin>>n; cin>>a>>b; t=(MOD-(b*powmod(a,MOD-2,MOD))%MOD)%MOD; po[0]=1; for(int i=1;i<=n;i++) po[i]=(po[i-1]*t)%MOD; cin>>q; for(int i=0;i>c[i]; for(int i=0;i=MOD) ans[i]%=MOD; } build_tree(1,0,n-1); while(q--){ cin>>type; if(type==1) { cin>>y>>x; c[y]=x; temp= (c[y]*powmod(t,y,MOD))%MOD; update(1,0,n-1,y,y,temp); } else { cin>>l>>r; temp=query(1,0,n-1,l,r)%MOD; temp=(temp*powmod(po[l],MOD-2,MOD))%MOD; if(temp==0) cout<<"Yes\n"; else cout<<"No\n"; } } }