#include using namespace std; typedef pair II; typedef vector< II > VII; typedef vector VI; typedef vector< VI > VVI; typedef long long int ll; #define mod 1000000007 #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #define ALL(a) a.begin(),a.end() #define forn(i, n) for(ll i = 0; i < ll(n); ++i) #define forv(i, n) for(int i = 0; i != int(n); ++i) #define cases int t; cin>>t; while(t--) #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL) int getMid(int s, int e) { return s + (e -s)/2; } ll getSumUtil(int *st, int ss, int se, int qs, int qe, int si) { if (qs <= ss && qe >= se) return 1LL*st[si]; if (se < qs || ss > qe) return 1LL*0; int mid = getMid(ss, se); return 1LL*getSumUtil(st, ss, mid, qs, qe, 2*si+1) + 1LL*getSumUtil(st, mid+1, se, qs, qe, 2*si+2); } void updateValueUtil(int *st, int ss, int se, int i, int diff, int si) { if (i < ss || i > se) return; st[si] = st[si] + diff; if (se != ss) { int mid = getMid(ss, se); updateValueUtil(st, ss, mid, i, diff, 2*si + 1); updateValueUtil(st, mid+1, se, i, diff, 2*si + 2); } } void updateValue(int arr[], int *st, int n, int i, int new_val) { int diff = new_val - arr[i]; arr[i] = new_val; updateValueUtil(st, 0, n-1, i, diff, 0); } ll getSum(int *st, int n, int qs, int qe) { return getSumUtil(st, 0, n-1, qs, qe, 0); } int constructSTUtil(int arr[], int ss, int se, int *st, int si) { if (ss == se) { st[si] = arr[ss]; return arr[ss]; } int mid = getMid(ss, se); st[si] = constructSTUtil(arr, ss, mid, st, si*2+1) + constructSTUtil(arr, mid+1, se, st, si*2+2); return st[si]; } int *constructST(int arr[], int n) { int x = (int)(ceil(log2(n))); int max_size = 2*(int)pow(2, x) - 1; int *st = new int[max_size]; constructSTUtil(arr, 0, n-1, st, 0); return st; } int main() { int n,q,l,r,d,c[100005]; ll sum,a,b,rx; cin>>n>>a>>b>>q; forn(i,n) cin>>c[i]; int *st = constructST(c, n); while(q--) { cin>>d>>l>>r; if(d==1) updateValue(c,st,n,l,r); else { sum=getSum(st,n,l,r); rx=sum%(a+b); if(rx%mod==0) cout<<"Yes\n"; else cout<<"No\n"; } } return 0; }