// semenInRussia 2025
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iostream>
#include <map>
#include <vector>
using namespace std;

const int maxn = 10100;
int a[maxn], b[maxn];

const int K = 5005;
int nxta[maxn][K], nxtb[maxn][K];

bool dp[maxn][maxn][2];

int n, m, q;

// vector<int> ps;

const int Q = 1e5 + 100;
int aa[Q], bb[Q];

int st = 0;

void read(vector<pair<int, int>> &as, vector<pair<int, int>> &bs) {
  if (as[0].second == bs[0].second) {
    st ^= 1;
    int p = min(as[0].first, bs[0].first) - 2;
    if (p >= 0) {
      as[0].first -= p;
      bs[0].first -= p;
    }
  }

  int sz = 0;
  for (int j = 0; j < n; j++) {
    auto [l, v] = as[j];
    while (l--) {
      a[sz++] = v;
    }
  }
  n = sz;

  sz = 0;
  for (int j = 0; j < m; j++) {
    auto [l, v] = bs[j];
    while (l--) {
      b[sz++] = v;
    }
  }
  m = sz;
}

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);

  int N, M, k;
  cin >> N >> n >> M >> m >> k >> q;

  vector<pair<int, int>> as(n), bs(m);

  for (auto &[l, r] : as) {
    cin >> l >> r;
    r--;
  }

  for (auto &[l, r] : bs) {
    cin >> l >> r;
    r--;
  }

  for (int j = 0; j < q; j++) {
    cin >> aa[j] >> bb[j];
  }

  read(as, bs);

#ifdef home
  cerr << "a: ";
  for (int i = 0; i < n; i++) {
    cerr << a[i] << " ";
  }
  cerr << "\n";

  cerr << "b: ";
  for (int i = 0; i < m; i++) {
    cerr << b[i] << " ";
  }
  cerr << "\n";
#endif

  for (int j = 0; j < k; j++) {
    nxta[n][j] = n;
    nxtb[m][j] = m;
  }

  for (int i = n - 1; i >= 0; i--) {
    for (int l = 0; l < k; l++) {
      nxta[i][l] = nxta[i + 1][l];
      if (a[i] == l) {
        nxta[i][l] = i;
      }
    }
  }

  for (int i = m - 1; i >= 0; i--) {
    for (int l = 0; l < k; l++) {
      nxtb[i][l] = nxtb[i + 1][l];
      if (b[i] == l) {
        nxtb[i][l] = i;
      }
    }
  }

  for (int i = n - 1; i >= 0; i--) {
    for (int p = 0; p <= 1; p++) {
      int j = 0;
      int cnt = 0;
      for (int v = 0; v < k; v++) {
        int ip = nxta[i][v] + 1;
        int jp = nxtb[j][v] + 1;
        if (ip == n + 1 || jp == m + 1) {
          continue;
        }
        cnt += !dp[ip][jp][p ^ 1];
      }
      for (j = 0; j < m; j++) {
        if (j > 0) {
          // we delete occurance of b[j]
          int v = b[j - 1];
          int ip = nxta[i][v] + 1;
          int jp = nxtb[j][v] + 1;
          if (ip != n + 1 && jp != m + 1) {
            if (!dp[ip][jp][p ^ 1]) {
              cnt++;
            }
          }
        }
        dp[i][j][p] = cnt > 0;
        // cerr << "(" << i << ", " << j << ") => " << "(" << ip << ", " << jp
        //      << ")\n";
        // assert(ip > i && jp > j);

        // we delete occurance of b[j]
        int v = b[j];
        int ip = nxta[i][v] + 1;
        int jp = nxtb[j][v] + 1;
        if (ip != n + 1 && jp != m + 1) {
          if (!dp[ip][jp][p ^ 1]) {
            cnt--;
          }
        }
      }
    }
  }

  for (int j = 0; j < q; j++) {
    int l = aa[j];
    int r = bb[j];
    bool ans = dp[l][r][0] ^ st;
    cout << (ans ? "Yes\n" : "No\n");
  }
}