#include #include #include #include #include #include using namespace std; typedef long long ll; #ifndef ASSERT # define ASSERT(a) { if(!(a)) { cerr << "WTF!?\n"; *(int*)0=0; } } #endif #define MOD 1000000007LL template T pow(T x, int power, T mod) { T res = 1; for(T b=x; power; power>>=1) { if(power&1) res = (res * b) % mod; b = (b * b) % mod; } return res; } ll divm(ll a, ll b) { ll ib = pow(b, MOD-2, MOD); ll x = a*ib % MOD; //ASSERT( x*b % MOD == a); return x; } template struct SegmentTree { T *a[30]; int n, depth; bool builded; OP op; SegmentTree(int n_, OP op_) : builded(false) , op(op_) { n = n_; depth = 0; for(int x=n; x; x>>=1) ++depth; for(int i=0; i<=depth; ++i) a[i] = new T[n]; } ~SegmentTree() { for(int i=0; i<=depth; ++i) delete[] a[i]; } void build() { int l = n; for(int d=1; d<=depth; ++d) { l = (l)/2; for(int i=0; i> n >> a >> b >> q; vector c(n); for(int i=0; i> c[i]; //ASSERT(b); ll ib = divm(1,b); ll ab = divm(a,b); vector w(n+1), xi(n+1); w[0] = 1; for(int i=1; i<=n; ++i) w[i] = (w[i-1] * ab) % MOD; SegmentTree stree(n+1, Sum()); ll x = 0; stree[0] = xi[0] = x; int sig = 1; for(int i=0; i> tp; if(tp == 1) { int j; ll xx; cin >> j >> xx; c[j] = xx; sig = (j%2 == 0 ? 1 : -1); ll y = (sig*(xx*w[n-j]%MOD) + MOD) % MOD; stree.update(j+1, y); } else { int l, r; cin >> l >> r; //ll y = (xi[r+1] - xi[l] + MOD) % MOD; if(b == 0) { if(c[l] == 0) cout << "Yes\n"; else cout << "No\n"; continue; } ll z = stree.get(l+1, r+1); //print4(l, r, y, z); if(z == 0) cout << "Yes\n"; else cout << "No\n"; } } return 0; }