import sys input = sys.stdin.readline class SegmentTree: def __init__(self, size, f=max, default=-10 ** 18): self.size = 2**(size-1).bit_length() self.default = default self.dat = [default]*(self.size*2) self.f = f def update(self, i, x): i += self.size self.dat[i] = x while i > 0: i >>= 1 self.dat[i] = self.f(self.dat[i*2], self.dat[i*2+1]) def query(self, l, r): l += self.size r += self.size lres, rres = self.default, self.default while l < r: if l & 1: lres = self.f(lres, self.dat[l]) l += 1 if r & 1: r -= 1 rres = self.f(self.dat[r], rres) l >>= 1 r >>= 1 res = self.f(lres, rres) return res N, Q, K = map(int, input().split()) A = list(map(int, input().split())) mod = 10 ** 9 + 9 p = [1] * (4*N + 1) for i in range(4*N): p[i + 1] = p[i] * K % mod def op(x, y): a = (x[0] + y[0] * p[x[1]]) % mod b = x[1] + y[1] return (a, b) T = SegmentTree(N, op, (0, 0)) for i in range(N): T.update(i, (A[i]%mod, 1)) for i in range(Q): l, r = map(int, input().split()) l -= 1 if T.query(l, r)[0]: print("Yes") else: print("No")