#include using namespace std; typedef long long ll; typedef long double ld; typedef pair pl; #define sl(x) scanf("%lld",&x) #define pl(x) printf("%lld\n",x) #define sf(x) sort(x.begin(),x.end(),func) #define s(x) sort(x.begin(),x.end()) #define all(v) v.begin(),v.end() #define rs(v) { s(v) ; r(v) ; } #define r(v) {reverse(all(v));} #define pb push_back #define mp make_pair #define F first #define S second #define f(i,n) for(int i=0;i= m) a -= m; if(a < 0) a += m; return a;} ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;} ll n, a, b, c[N], q; int main() { ios_base::sync_with_stdio(0); cin >> n >> a >> b >> q; f(i, n) cin >> c[i]; f(i, q) { ll t; cin >> t; if(t == 1) { ll in, x; cin >> in >> x; c[in - 1] = x; } else { ll l, r; cin >> l >> r; l--; r--; ll lol = 0; for(ll j = l; j <= r; j++) { lol = add(lol, mul(mul(c[j], power(-b, j - l)) , power(power(a, j - l), mod - 2))); } if(lol == 0) { cout << "Yes\n"; } else { cout << "No\n"; } } } return 0; }