#include #include #include #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; #define f first #define s second #define pb push_back #define pp pop_back #define mp make_pair #define ll long long #define ld long double const int N = 1e6 + 123; const ld Pi = acos(-1); const int mod = 1e9 + 7; const ll Inf = 1e18; const int inf = 1e9; int n, a[N], A, B, q, b[N], s[N], pw[N], t[N * 4]; void add(int &a, int b) { a += b; if (a >= mod) a -= mod; } int mult(int a, int b) { return 1ll * a * b % mod; } int sum(int a, int b) { add(a, b); return a; } int bp(int a, int n) { int ans = 1; while(n) { if (n & 1) ans = mult(ans, a); a = mult(a, a); n >>= 1; } return ans; } int inv; bool get(int l, int r) { int now = 0; int sg = 1; for (int i = l + 1;i <= r;i++) { if (sg == -1) { add(now, mod - mult(a[i], pw[i - l])); } else { add(now, mult(a[i], pw[i - l])); } sg = -sg; } // cout << "l = " << l << " now = " << now << " a = " << a[l] << endl; return now == a[l]; } int main() { #ifdef wws freopen("in", "r", stdin); // freopen("out", "w", stdout); #endif ios_base::sync_with_stdio(0); cin >> n >> A >> B >> q; inv = bp(A, mod - 2); pw[0] = 1; for (int i = 1, up = B, dw = inv;i <= n;i++) { pw[i] = mult(pw[i - 1], mult(B, inv)); } for (int i = 0;i < n;i++) cin >> a[i]; for (int it = 0, t, p, x, l, r;it < q;it++) { cin >> t; if (t == 1) { cin >> p >> x; a[p] = x; } else { cin >> l >> r; if (get(l, r)) { cout << "Yes\n"; } else { cout << "No\n"; } } } return 0; }