/*input 3 2 2 3 1 2 3 2 0 2 1 2 1 2 0 2 */ #include #include using namespace std; #define F(i,a,b) for(ll i = a; i <= b; i++) #define RF(i,a,b) for(ll i = a; i >= b; i--) #define pii pair #define PI 3.14159265358979323846264338327950288 #define ll long long #define ff first #define ss second #define pb(x) push_back(x) #define mp(x,y) make_pair(x,y) #define debug(x) cout << #x << " = " << x << endl #define INF 1000000009 #define mod 1000000007 #define S(x) scanf("%d",&x) #define S2(x,y) scanf("%d%d",&x,&y) #define P(x) printf("%d\n",x) #define all(v) v.begin(),v.end() ll arr[200005]; ll power(ll a,ll b) { ll ans = 1; while(b > 0) { if(b%2) ans *= a; a = a*a; b /= 2; ans %= mod; a %= mod; } return ans; } int main() { std::ios::sync_with_stdio(false); ll n,a,b,q; cin>>n>>a>>b>>q; F(i,0,n-1) cin>>arr[i]; while(q--) { ll type; cin>>type; if(type == 1) { ll id,x; cin>>id>>x; arr[id] = x; } else { ll l,r; cin>>l>>r; bool flag = 1; ll ans = 0; ll p = 0; F(i,l,r) { ll num = arr[i]; num = num * power(b,p); num %= mod; ll denom = power(a,p); num = num * power(denom,mod-2); num %= mod; if(flag) ans = ans + num; else ans = ans - num; if(ans < 0) ans += mod; ans %= mod; flag = !flag; p++; } if(ans) cout<<"No"; else cout<<"Yes"; cout<