#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; typedef unsigned long long uint64; const long long MODULO = 1000000007; uint64 powmod(uint64 b, uint64 p, uint64 m = MODULO) { if (p == 0) { return 1; } else if (p % 2 == 0) { uint64 x = powmod(b, p / 2, m); return (x * x) % m; } else { return ((b % m) * powmod(b, p - 1, m)) % m; } } uint64 mulmod(uint64 a, uint64 b, uint64 m = MODULO) { return (a * b) % m; } int main(){ int n; int a; int b; int q; cin >> n >> a >> b >> q; int inv_a = powmod(a, MODULO - 2); int inv_b = powmod(b, MODULO - 2); vector c(n); for(int c_i = 0; c_i < n; c_i++){ cin >> c[c_i]; } for(int a0 = 0; a0 < q; a0++){ int queryType; int first; int second; cin >> queryType >> first >> second; if (queryType == 1) { c[first] = second; continue; } vector v(c.begin() + first, c.begin() + second + 1); reverse(v.begin(), v.end()); int rem = v[0]; int v_size = v.size(); for (int i = 1; i < v_size; i++) { int d = mulmod(rem, inv_a); rem = v[i] - mulmod(b, d); if (rem < 0) { rem += MODULO; } } if (rem) { cout << "No" << endl; } else { cout << "Yes" << endl; } } return 0; }