#include using namespace std; int main() { int n,aa,b,q,i,x,l,r,sum,sum1; cin>>n>>aa>>b>>q; long int a[n]; for(i=0;i>a[i]; while(q--) { cin>>x>>l>>r; if(x==1) { a[l]=r; } else { sum=0; if(r-l==0) { sum=a[l]; if((1000000007-sum)%b==0) cout<<"Yes"<=<<"Yes"<