#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF (1LL<<60)
#define MOD 1000000007
inline void chmax(long long &x, long long v) { if (x < v) x = v; }

int N, M, T, Q;
long long dp[20][1000];
long long S[2][1000];
void merge(long long O[], long long A[], long long B[]) {
  rep(a, T) {
    if (A[a] == -INF) continue;
    rep(b, T) {
      if (B[b] == -INF) continue;
      chmax(O[(a+b)%T], A[a]+B[b]);
    }
  }
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> M >> T;
  rep(k, 20) rep(i, T) dp[k][i] = -INF;
  dp[0][0] = 0;
  rep(i, N) {
    int a;
    cin >> a;
    chmax(dp[0][a%T], a);
  }
  rep(k, 19) merge(dp[k+1], dp[k], dp[k]);

  rep(i, T) S[0][i] = -INF; S[0][0] = 0;
  rep(k, 20) if ((M>>k)&1) {
    rep(i, T) S[1][i] = -INF;
    merge(S[1], S[0], dp[k]);
    swap(S[0], S[1]);
  }

  for (int i=T-2; i>=0; i--) chmax(S[0][i], S[0][i+1]);
  cin >> Q;
  rep(i, Q) {
    int a, b;
    cin >> a >> b;
    if (S[0][a] >= 1LL*T*b) cout << "yes\n";
    else cout << "no\n";
  }
  return 0;
}