#include #include #include using namespace std; const int p = 1000000000 + 7; int szybko( unsigned long long int a, unsigned long long int b, int m ) { unsigned long long int i; unsigned long long int result = 1; unsigned long long int x = a%m; for( i = 1; i <= b; i <<= 1) { x %= m; if ((b&i) != 0) { result *= x; result %= m; } x *= x; } return result; } int main() { ios_base::sync_with_stdio(0); int n, q, a, b; cin >> n >> a >> b >> q; int c[n]; for( int i = 0; i < n; i ++ ) { cin >> c[i]; } //cout << szybko( a, p-2, p ); unsigned long long int pierwiastek = szybko( a, p-2, p); pierwiastek *= (p-b); pierwiastek %= p; while( q -- ) { int z, r, l; cin >> z >> l >> r; if( z == 1 ) { c[l] = r; } else { unsigned long long int pot = 1; unsigned long long int wyn = 0; for( int i = l; i <= r; i ++ ) { wyn += ((pot*c[i])%p); wyn %= p; pot *= pierwiastek; pot %= p; } if( wyn % p == 0 ) cout << "Yes\n"; else cout << "No\n"; } } return 0; }