#include using namespace std; #define TRACE #ifdef TRACE #define TR(...) __f(#__VA_ARGS__, __VA_ARGS__) template void __f(const char* name, Arg1&& arg1){ cerr << name << " : " << arg1 << std::endl; } template void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...); } #else #define TR(...) #endif typedef long long LL; typedef vector < int > VI; typedef pair < int,int > II; typedef vector < II > VII; #define MOD 1000000007 #define EPS 1e-12 #define N 200100 #define PB push_back #define MP make_pair #define F first #define S second #define ALL(v) v.begin(),v.end() #define SZ(a) (int)a.size() #define FILL(a,b) memset(a,b,sizeof(a)) #define SI(n) scanf("%d",&n) #define SLL(n) scanf("%lld",&n) #define PLLN(n) printf("%lld\n",n) #define PIN(n) printf("%d\n",n) #define REP(i,j,n) for(LL i=j;i=j;i--) #define endl '\n' #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL) #define FILEIO(name) \ freopen(name".in", "r", stdin); \ freopen(name".out", "w", stdout); inline int mult(int a , int b) { LL x = a; x *= LL(b); if(x >= MOD) x %= MOD; return x; } inline int add(int a , int b) { return a + b >= MOD ? a + b - MOD : a + b; } inline int sub(int a , int b) { return a - b < 0 ? MOD - b + a : a - b; } LL powmod(LL a,LL b) { if(b==0)return 1; LL x=powmod(a,b/2); LL y=(x*x)%MOD; if(b%2) return (a*y)%MOD; return y%MOD; } int c[N]; int a , b; int inv; bool divdes(VI & p) { int n = SZ(p); int val = 0; PER(i,1,n) { int y = sub(p[i] , val); int x = mult(y , inv); val = mult(x , b); } int y = sub(p[0] , val); if(y == 0) return true; return false; } int main() { int n , q; SI(n); SI(a); SI(b); SI(q); inv = powmod(a,MOD-2); REP(i,0,n) SI(c[i]); while(q--) { int type,l,r; SI(type); SI(l); SI(r); if(type == 1) { c[l] = r; } else { VI p; REP(i,l,r+1) p.PB(c[i]); if(divdes(p)) puts("Yes"); else puts("No"); } } return 0; }