#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; #define REP(i, n) for (int i = 0; i < (n); ++i) typedef long long int LL; const LL P = 1000000007; int main(){ int n; int a; int b; int q; cin >> n >> a >> b >> q; vector c(n); for(int c_i = 0; c_i < n; c_i++){ cin >> c[c_i]; } vector coef(n); LL cur = 1; REP(i, n) { coef[i] = cur; cur = (cur * -b) % P; } cur = 1; for (int i = n - 1; i >= 0; --i) { coef[i] = (coef[i] * cur) % P; cur = (cur * a) % P; } /* REP(i, n) { cout << coef[i] << " "; } cout << "\n"; */ for(int a0 = 0; a0 < q; a0++){ int queryType; int first; int second; cin >> queryType >> first >> second; // your code goes here if (queryType == 1) { c[first] = second; } else { LL cur = 0; for (int i = first; i <= second; i++) { cur = (cur + ((LL) c[i]) * coef[i]) % P; } if (cur) { cout << "No\n"; } else { cout << "Yes\n"; } } } return 0; }