#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic #include #include //do setprecision #include #include using namespace std; #define FOR(i,b,e) for(int i=(b);i<(e);++i) #define FORQ(i,b,e) for(int i=(b);i<=(e);++i) #define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i) #define REP(x, n) for(int x = 0; x < (n); ++x) #define ST first #define ND second #define PB push_back #define MP make_pair #define LL long long #define ULL unsigned LL #define LD long double const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342; const int MOD = 1e9 + 7; const int N = 1e5 + 10; /***szybkie potegowanie***/ int square(int x) { return (x * (LL)x) % MOD; } int bigmod(int b, int w, int p) { if (w == 0) return 1; else if (w % 2 == 0) return square(bigmod(b, w / 2, p)) % p; // square(x) = x * x else return (b * (LL)bigmod(b, w - 1, p)) % p; }//bigmod inline int mul(int x, int y) { LL v = x*(LL)y; if (v >= MOD) v %= MOD; return v; } // string s = "11 1011 1001 1010 1100 1010 0000 0101"; inline int odwp(int g) { int x1 = g, x2 = square(g); // 11 x1 = mul(x1, x2); x2 = square(x2); // 1011 x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); x1 = mul(x1, x2); x2 = square(x2); x1 = mul(x1, x2); x2 = square(x2); // 1001 x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); x2 = mul(x1, x2); x1 = square(x1); x1 = mul(x1, x2); x2 = square(x2); // 1010 x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); // 1100 x1 = mul(x1, x2); x2 = square(x2); x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); x2 = mul(x1, x2); x1 = square(x1); // 1010 x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); // 0000 x2 = mul(x1, x2); x1 = square(x1); x2 = mul(x1, x2); x1 = square(x1); x2 = mul(x1, x2); x1 = square(x1); x2 = mul(x1, x2); x1 = square(x1); // 0101 x2 = mul(x1, x2); x1 = square(x1); x1 = mul(x1, x2); x2 = square(x2); x2 = mul(x1, x2); x1 = square(x1); x1 = mul(x1, x2); x2 = square(x2); return x1; } inline int sub(int x, int y) { int v = x - y; if (v < 0) v += MOD; return v; } inline int add(int x, int y) { int v = x + y; if (v >= MOD) v -= MOD; return v; } int c[N]; int main() { int n, a, b, q; scanf("%d%d%d%d", &n, &a, &b, &q); // spr do odp formy Q b = mul(b, odwp(a)); b = sub(MOD, b); //printf("%d\n", b); REP(i, n) scanf("%d", &c[i]); REP(i, q) { int t; scanf("%d", &t); if (t == 1) { int i, x; scanf("%d%d", &i, &x); c[i] = x; } else { int l, r; scanf("%d%d", &l, &r); int res = 0; FORD(i, r + 1, l) { res = mul(res, b); res = add(res, c[i]); } if (res) printf("No\n"); else printf("Yes\n"); } } return 0; }