/* ta yag odo batorshihiin code harj bn */ #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 long long ll; const ll MOD = 1000000007ll; const ll INFl = 9223372036854775807ll; const int inf = (1 << 29) - 1; #define ff first #define ss second #define pb push_back #define _N 100005 #define mk make_pair ll power(ll x, ll y, ll z) { ll t = 1; while (y > 0) { if (y % 2) { t = (t * x) % z; } x = (x * x) % z; y /= 2; } return t; } int movex[4] = {0, 1, -1, 0}; int movey[4] = {1, 0, 0, -1}; const int N = 2005; bool f[_N + 2]; long long sqr (long long x) { return x * x; } long long c[_N]; int main () { long long a, b, p0; int n, i, l, r, type, j, Q; scanf ("%d%lld%lld%d", &n, &a, &b, &Q); for (i = 0;i < n; i ++) scanf ("%lld", &c[i]); while (Q --) { scanf ("%d%d%d", &type, &l, &r); if (type == 1) c[l] = r * 1ll; else { p0 = (c[l] * power (b, MOD - 2, MOD)) % MOD; for (j = l + 1;j < r; j ++) { p0 = (((c[j] - (p0 * a) % MOD + MOD) % MOD) * power (b, MOD - 2, MOD)) % MOD; } if ((p0 * a) % MOD == c[r]) printf ("Yes\n"); else printf ("No\n"); } } return 0; }