/*NAME: SANYAM GARG INSTITUTION : DELHI TECHNOLOGICAL UNIVERSITY*/ #include #include #include #include #include #include #include #include #include #include #define mod 1000000007 #define li long long int #define ll long long int #define readi(x) scanf("%d",&x) #define reads(x) scanf("%s",&x) #define readl(x) scanf("%I64d",&x) #define rep(i,n) for(i=0;i=0;i--) #define myrep1(i,a,b) for(i=a;i<=b;i++) #define myrep2(i,a,b) for(i=b;i>=a;i--) #define pb push_back #define mp make_pair #define fi first #define sec second #define MAXN 10000000000000000LL #define MINN -1000000000000000000 #define pii pair #define pic pair #define N 300000 #define lgn 20 #define ddouble long double #define minus minu using namespace std; void EE(ll a, ll b, ll& x, ll& y) { if(a%b == 0) { x=0; y=1; return; } EE(b,a%b,x,y); ll temp = x; x = y; y = temp - y*(a/b); } ll inverse(ll a,ll m) { ll x,y; EE(a,m,x,y); if(x<0) x += m; return x; } ll gcd(ll a,ll b) { while(b) { a%=b; swap(a,b); } return a; } ll ar[N]; int main() { ll n,a,b,q; cin>>n>>a>>b>>q; for(ll i=0;i>ar[i]; } while(q--) { ll x; cin>>x; if(x==1) { ll i,p; cin>>i>>p; ar[i]=p; } else { ll l,r; cin>>l>>r; ll temp=1; ll root=(((-1)*(b))*inverse(a,mod))%mod,val=0; for(ll i=l;i<=r;i++) { val=(val+ar[i]*temp)%mod; temp=(temp*root)%mod; } if(val==0) { cout<<"Yes\n"; } else { cout<<"No\n"; } } } }