#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define forn(i, n) for (int i = 0; i < (int)(n); ++i) #define for1(i, n) for (int i = 1; i <= (int)(n); ++i) #define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i) #define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i) using namespace std; typedef pair pii; typedef vector vi; typedef vector vpi; typedef vector vvi; typedef long long i64; typedef vector vi64; typedef vector vvi64; template bool uin(T &a, T b) { return a > b ? (a = b, true) : false; } template bool uax(T &a, T b) { return a < b ? (a = b, true) : false; } const int maxn = 110000; const i64 P = 1000000000 + 7; i64 deg(i64 x, i64 d) { d %= P - 1; if (d < 0) d += P - 1; i64 y = 1; while (d) { if (d & 1) y *= x, y %= P; x *= x, x %= P; d /= 2; } return y; } i64 f[maxn], d[maxn], a[maxn]; void add(i64 &x, i64 y) { x += y; x %= P; } void fadd(int i, i64 x) { for (; i < maxn; i |= i + 1) add(f[i], x); } i64 fsum(int i) { i64 s = 0; for (; i >= 0; i &= i + 1, --i) add(s, f[i]); return s; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.precision(10); cout << fixed; #ifdef LOCAL_DEFINE freopen("input.txt", "rt", stdin); #endif int n, q; i64 A, B; cin >> n >> A >> B >> q; i64 z = -B * deg(A, -1) % P; // cerr << z << '\n'; d[0] = 1; forn(i, n) { cin >> a[i]; // a[i] *= d[i]; a[i] %= P; d[i + 1] = d[i] * z % P; } forn(i, n) fadd(i, a[i] * d[i]); forn(i, q) { int t; cin >> t; if (t == 1) { int i; i64 x; cin >> i >> x; // --i; fadd(i, (x - a[i]) * d[i]); a[i] = x; } else { int l, r; cin >> l >> r; // --l; ++r; i64 res = fsum(r - 1) - fsum(l - 1); res %= P; if (!z) res = a[l]; // cerr << res << '\n'; cout << (res ? "No" : "Yes") << '\n'; } } #ifdef LOCAL_DEFINE cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"; #endif return 0; }