#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const int maxN=1e5+100; const int base=1e9+7; int lt[maxN], t[maxN*5], c[maxN]; int a; int b; int len; int luythua(int x,int y) { if (y==0) return 1; int t=luythua(x,y/2); t=(1ll*t*t)%base; if (y%2==0) return t; t=1ll*t*x%base; return t; } void update(int k,int l,int r,int i) { if (ir) return; if (l==r) { t[k]=c[i]; return; } int mid=(l+r)/2; update(k*2,l,mid,i); update(k*2+1,mid+1,r,i); t[k]=(1ll*t[k*2]+1ll*t[k*2+1]*lt[mid-l+1])%base; } int getans(int k,int l,int r,int i,int j) { if (r> n >> a >> b >> q; int kk = (-1ll*b*luythua(a, base-2)%base+base)%base; int ss = (1ll*a*kk+b)%base; //cout << ss << endl; lt[0]=1; a = kk; for(int i=1;i<=n;i++) lt[i]=1ll*lt[i-1]*a%base; for(int c_i = 0; c_i < n; c_i++){ cin >> c[c_i]; update(1,0,n-1,c_i); } if (a==0) { for(int a0=0; a0> queryType >> first >> second; len = 0; if (queryType == 1) { c[first] = second; update(1,0,n-1,first); } else { //cout << getans(1,0,n-1,first,second)%base << endl; if (getans(1,0,n-1,first,second)%base==ss) printf("Yes\n"); else printf("No\n"); } // your code goes here } return 0; }