/* jai shree ram _/\_ A hacker from NITP */ #include using namespace std; #define mod 1000000007 typedef set ss; typedef vector vs; typedef map msi; typedef pair pa; typedef long long int ll; ll power(ll a,ll b) { if(b==0) return 1; ll ret=power(a,b/2); if(b&1) return (((a*ret)%mod)*ret)%mod; return (ret*ret)%mod; } ll n,a,b,q,i,ch,l,r,c[100005],p,u,inv,ans; int main() { //freopen("inputf.in", "r", stdin); //freopen("o.out", "w", stdout); ios_base::sync_with_stdio(false); cin.tie(0); cin>>n>>a>>b>>q; swap(a,b); for(i=0;i>c[i]; while(q--) { cin>>ch>>l>>r; if(ch==1) c[l]=r; else { p=power(b,r-l); inv=power(b,mod-2); u=1; ans=0; for(i=l;i<=r;i++) { if((i-l)%2==0) ans=(ans+((c[i]*p)%mod)*u)%mod; else ans=((ans-((((c[i]*p)%mod)*u)%mod))%mod +mod)%mod; p=(p*inv)%mod; u=(u*a)%mod; } if(ans==0) cout<<"Yes\n"; else cout<<"No\n"; } } return 0; }