#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ull unsigned long long #define ll long long #define inf 1000000000 #define INF 1000000000000000000ll #define F first #define S second #define mp make_pair #define pb push_back #define pii pair < int , int > #define pll pair < ll , ll > #define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); ++ it) #define all(a) a.begin(), a.end() #define sqr(x) (x) * (x) #define sqrl(x) (x) * 1ll * (x) const int N = 100005; const int mod = 1000000007; int n, q; int a, b; int c[N], cc[N]; int p[N]; int bin_pow(int a, int b){ int res = 1; while(b){ if(b & 1) res = res * 1ll * a % mod; a = a * 1ll * a % mod; b >>= 1; } return res; } inline void sub(int &a, int b){ if((a -= b) < 0) a += mod; } void solve(int l, int r){ for(int i = l;i <= r;++ i) cc[i] = c[i]; for(int i = r;i > l;-- i){ if(cc[i] < 0){ cout << "No" << endl; return; } p[i] = cc[i] * 1ll * bin_pow(a, mod - 2); sub(cc[i], p[i] * 1ll * a % mod); sub(cc[i - 1], p[i] * 1ll * b % mod); } if(cc[l] != 0){ cout << "No" << endl; return; } cout << "Yes\n"; } int main (){ ios_base::sync_with_stdio(0); cin.tie(); cin >> n >> a >> b >> q; for(int i = 0;i < n;++ i) cin >> c[i]; while(q --){ int type; cin >> type; if(type == 1){ int i, num; cin >> i >> num; c[i] = num; } else { int l, r; cin >> l >> r; solve(l, r); } } return 0; }