#pragma comment(linker, ”/STACK:36777216“) #include #define x first #define y second #define y0 hi1 #define y1 hi2 #define ll long long #define mp make_pair #define pb push_back #define sqr(a) (a)*(a) #define ld long double #define all(a) (a).begin(), (a).end() using namespace std; const int inf = 2000000000; const int md = 1e9 + 7; ll binpow(ll a, ll b){ if(b == 0){ return 1; } if(b % 2){ return a * binpow(a, b - 1) % md; } ll x = binpow(a, b / 2); return x * x % md; } ll inv(ll a){ return binpow(a, md - 2); } int main(){ cin.tie(0); ios_base::sync_with_stdio(0); //freopen("1.txt", "r", stdin); ll n, q, a, b; cin >> n >> a >> b >> q; ll c[n], d[n], f[n]; for(int i = 0; i < n; i++){ cin >> c[i]; } while(q--){ int t, l, r; cin >> t >> l >> r; if(t == 1){ c[l] = r; } else { bool p = 1; if(b){ ll x = c[l] * inv(b) % md; d[0] = x; for(int j = l + 1; j <= r; j++){ x = (c[j] - a * x) % md; if(x < 0){ x += md; } x = x * inv(b) % md; d[j - l] = x; } } else if(b == 0){ for(int i = 0; i < r - l; i++){ d[i] = inv(a) * c[l + i + 1] % md; } } if(p){ for(int i = 0; i <= r - l; i++){ f[i] = ((i < r - l ? b * d[i] : 0) + (i > 0 ? a * d[i - 1] : 0)) % md; if(f[i] != c[i + l]){ p = 0; } } } cout << (p ? "Yes" : "No") << "\n"; } } }