#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, q; long long k; cin >> n >> q >> k; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; vector>> qs(n); for (int i = 0; i < q; i++) { int l, r; cin >> l >> r; qs[l - 1].emplace_back(r, i); } vector d(n), carry(n + 1); vector ans(q); vector nonzero{n}; for (int i = n - 1; i >= 0; i--) { long long now = a[i]; int j = i; for (; now && j < n; j++) { now += d[j]; auto q = now / k, r = now % k; d[j] = r; carry[j + 1] += q; now = q; } while (nonzero.back() < j) nonzero.pop_back(); while (--j >= i) { if (d[j]) nonzero.emplace_back(j); } for (auto [r, iq] : qs[i]) ans[iq] = nonzero.back() < r || carry[r]; } for (int i = 0; i < q; i++) cout << (ans[i] ? "Yes" : "No") << '\n'; }