#include <bits/stdc++.h>
using namespace std;

void outer_sum(int& a, int& b) {
    if (a == 0) {
        a = b;
    } else if (b == 0) {

    } else if (b == a) {

    } else {
        a = -1;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, n, M, m, k, Q, q, r;
    cin >> N >> n >> M >> m >> k >> Q;
    vector<int> la{0}, lb{0}, va{}, vb{};
    for (int i = 0; i < n; i++) {
        cin >> q >> r;
        r--;
        for (int i = 0; i < q; i++) {
            va.push_back(r);
        }
    }
    for (int i = 0; i < m; i++) {
        cin >> q >> r;
        r--;
        for (int i = 0; i < q; i++) {
            vb.push_back(r);
        }
    }
    vector<int> prev_c(k, -1);
    vector<int> preva(N, 0), prevb(M, 0);
    for (int i = 0; i < N; i++) {
        preva[i] = prev_c[va[i]];
        prev_c[va[i]] = i;
    }
    prev_c.assign(k, -1);
    for (int i = 0; i < M; i++) {
        prevb[i] = prev_c[vb[i]];
        prev_c[vb[i]] = i;
    }
    vector<vector<int>> count_bob(N + 2, vector<int>(M + 2, 0));
    for (int i = N; i >= 0; i--) {
        for (int j = M; j >= 0; j--) {
            count_bob[i][j] = count_bob[i][j] + count_bob[i + 1][j] + count_bob[i][j + 1] - count_bob[i + 1][j + 1];
            cout << count_bob[i][j] << " ";
            if ((i > 0) && (j > 0) && ((va[i - 1] == vb[j - 1]) && (count_bob[i][j] == 0))) {
                //cout << i - 1 << " " << j - 1 << " " << preva[i - 1] << " " << prevb[j - 1] << endl;
                count_bob[i - 1][j - 1]++;
                if (preva[i - 1] >= 0) {
                    if (prevb[j - 1] >= 0) {
                        count_bob[preva[i - 1]][prevb[j - 1]]++;
                    }
                }
                if (preva[i - 1] >= 0) {
                    count_bob[preva[i - 1]][j - 1]--;
                }
                if (prevb[j - 1] >= 0) {
                    count_bob[i - 1][prevb[j - 1]]--;
                }
            }
        }
        cout << endl;
    }
    for (int i = 0; i < Q; i++) {
        cin >> q >> r;
        cout << (count_bob[q][r] > 0 ? "Yes" : "No") << endl;
    }
}
