#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef unsigned long long ll; int main(){ ll n; ll a; ll b; ll q; cin >> n >> a >> b >> q; vector c(n); for(ll c_i = 0; c_i < n; c_i++){ cin >> c[c_i]; } for(ll a0 = 0; a0 < q; a0++){ ll queryType; ll first; ll second; cin >> queryType >> first >> second; // your code goes here if (queryType == 1) { c[first] = second; } else { ll p = 0; for (ll g = 0; g < n; g++) { p += c[g] * pow((a0+1), g); } ll q = a*(a0+1) + b; if ( p % q == 0) cout << "Yes" << endl; else cout << "No" << endl; } } return 0; }