#pragma comment(linker, "/STACK:64777216") #define _CRT_SECURE_NO_WARNINGS #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 FOR(i,a,b) for (int i = (a); i < (b); i++) #define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--) #define ITER(it, a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL(a, value) memset(a, value, sizeof(a)) #define SZ(a) (int)a.size() #define ALL(a) a.begin(), a.end() #define MP make_pair #define PB push_back typedef long long LL; typedef vector VI; typedef pair PII; const double PI = acos(-1.0); const int INF = 1000 * 1000 * 1000 + 7; const LL LINF = INF * (LL)INF; const int MAX = 100100; const int MOD = 1000 * 1000 * 1000 + 7; int C[MAX]; LL P[MAX]; LL bpow(LL a, LL b) { LL res = 1; while (b) { if (b & 1) res = (res * a) % MOD; a = (a * a) % MOD; b /= 2; } return res; } LL inv(LL a) { return bpow(a, MOD - 2); } LL F[MAX]; int n; void add(int x, LL val) { for (; x < n; x = x | (x + 1)) { F[x] = (F[x] + val); if (F[x] >= MOD) F[x] -= MOD; if (F[x] < 0) F[x] += MOD; } } LL get(int x) { LL res = 0; for (; x >= 0; x = (x & (x + 1)) - 1) { res += F[x]; if (res >= MOD) res -= MOD; } return res; } LL get(int L, int R) { LL res = get(R); if (L != 0) res -= get(L - 1); if (res >= MOD) res -= MOD; if (res < 0) res += MOD; return res; } int main() { //freopen("in.txt", "r", stdin); //ios::sync_with_stdio(false); cin.tie(false); int q, a, b; scanf("%d%d%d%d", &n, &a, &b, &q); LL x = -b * inv(a); x %= MOD; if (x < 0) x += MOD; P[0] = 1; FOR(i, 0, n) { scanf("%d", &C[i]); LL val = C[i] * P[i]; val %= MOD; add(i, val); P[i + 1] = (P[i] * x) % MOD; } FOR(i, 0, q) { int t; scanf("%d", &t); if (t == 1) { int p, y; scanf("%d%d", &p, &y); add(p, (-C[p] * P[p]) % MOD); C[p] = y; add(p, (C[p] * P[p]) % MOD); } else { int L, R; scanf("%d%d", &L, &R); if (x == 0) { if (C[L] == 0) printf("Yes\n"); else printf("No\n"); } else { LL sum = get(L, R); //cout << sum << endl; if (sum == 0) printf("Yes\n"); else printf("No\n"); } } } return 0; }