#include #include #include #include #include using namespace std; typedef long L; class I; I operator + (const I& a, const I& b); I operator - (const I& a, const I& b); I operator * (const I& a, const I& b); I operator / (const I& a, const I& b); class I { public: static const int M = 998244353; int d; I(int iD) : d(iD) { } I() {} inline static I power(I r, L n); inline static I inv(I r) { return power(r, M - 2); } I& operator += (const I& other) { return *this = (*this + other); } I& operator -= (const I& other) { return *this = (*this - other); } I& operator *= (const I& other) { return *this = (*this * other); } I& operator /= (const I& other) { return *this = (*this / other); } }; inline L MBound(L v) { return v < I::M ? v : (v - I::M); } inline I operator + (const I& a, const I& b) { return MBound(a.d + b.d); } inline I operator - (const I& a, const I& b) { return (a + I(I::M - b.d)); } inline I operator * (const I& a, const I& b) { return (a.d * (L) b.d) % I::M; } inline I operator / (const I& a, const I& b) { return (a * I::inv(b)); } inline I I::power(I r, L n) { I y = 1; while (n > 0) { if ((n & 1) != 0) { y = y * r; } r = r * r; n >>= 1; } return y; } int main() { int n, a, b, q; cin >> n >> a >> b >> q; I A = I(a); vector x(n); for (int z = 0; z < n; ++z) cin >> x[z]; while (q--) { char c; cin >> c; if (c == '1') { int i; cin >> i >> x[i]; } else { int l, r; cin >> l >> r; I lastR = 0; for (int w = l; w < r; ++w) { lastR = (I(x[w]) - A * lastR) / b; } cout << ((x[r] == (A * lastR).d) ? "Yes" : "No") << endl; } } return 0; }