//Created By Mayur Agarwal :) #include #include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #define ind(a) scanf("%d",&a) #define in(a) scanf("%lld",&a) #define inc(a) scanf("%c",&a) #define ins(a) scanf("%s",a) #define pr(a) printf("%lld\n",a) #define bitcnt(x) __builtin_popcountll(x) #define debug(x) cout << #x << " = " << x << endl #define MS0(X) memset((X), 0, sizeof((X))) #define MS1(X) memset((X), -1, sizeof((X))) #define pb push_back #define MP make_pair #define ff first #define ss second #define SIZE 200010 const ll mod = 1000000007L; using namespace std; typedef pairpll; ll n, a, b, q; ll A[SIZE], B[SIZE], inv[SIZE]; ll tree[4 * SIZE], ar[SIZE]; ll powmod(ll base, ll exp, ll Mod) { ll res = 1; while (exp) { if (exp & 1) { res = (res * base) % Mod; } base = (base * base) % Mod; exp >>= 1; } return res; } ll merge(ll l, ll r, ll l1, ll l2) { ll x = (l * A[l2]) % mod; x = (x * inv[l2]) % mod; ll m; if (l1 % 2 == 0) m = 1; else m = -1; x = (x + m * r + mod) % mod; return x; } void update(int id, int s, int e, int idx, ll val) { if (s == e) { tree[id] = val % mod; return; } int mid = (s + e) / 2 ; if (idx <= mid) update(2 * id, s, mid, idx, val); else update(2 * id + 1, mid + 1, e, idx, val); tree[id] = merge(tree[2 * id], tree[2 * id + 1], mid - s + 1, e - mid); } ll query(int node, int s, int e, int l, int r) { if (s >= l && e <= r) return tree[node]; int mid = (s + e) / 2; if (r <= mid) return query(2 * node , s, mid, l, r); if (l > mid) return query(2 * node + 1, mid + 1, e, l, r); ll lft = query(2 * node, s, mid, l, mid); ll rig = query(2 * node + 1, mid + 1, e , mid + 1 , r); return merge(lft, rig, mid - l + 1, r - mid); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> a >> b >> q; A[0] = B[0] = 1; for (int i = 1; i <= n; i++) { A[i] = (A[i - 1] * a) % mod; B[i] = (B[i - 1] * b) % mod; inv[i] = powmod(B[i], mod - 2, mod); } for (int i = 0; i < n; i++) { cin >> ar[i]; update(1, 0, n - 1, i, ar[i]); } while (q--) { int typ, l, r; cin >> typ >> l >> r; if (typ == 1) update(1, 0, n - 1, l, r); else { ll ans = query(1 , 0, n - 1, l, r); if (ans == 0) cout << "Yes\n"; else cout << "No\n"; } } return 0; }