#include #include #include #include #include using namespace std; int main() { static const long long P = pow(10, 9) + 7; int n, a, b, q; cin >> n >> a >> b >> q; vector c(n); for (int i=0; i < n; ++i) { cin >> c[i]; } for (int i=0; i < q; ++i) { int t, k, p; cin >> t >> k >> p; if (t == 1) { c[k] = p; } else if (t == 2) { long long x = -b / a; long long res = 0; for (int j=k; j<=p; ++j) { res += c[j] * pow(x,j-k); } if (res % P == 0) cout << "Yes" << endl; else cout << "No" << endl; } else { cerr << "Invalid input!" << endl; return -1; } } return 0; }