#include <iostream>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <set>
#include <bitset>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <random>

using namespace std;

random_device rd;
mt19937 rnd(rd());

// #define int long long

void yes() {
    cout << "Yes\n";
}

void no() {
    cout << "No\n";
}

void solve() {
    int N, n, M, m, k, q; cin >> N >> n >> M >> m >> k >> q;
    vector<int> a;
    for (int i = 0; i < n; i++) {
        int l, v; cin >> l >> v;
        v--;
        for (int j = 0; j < l; j++) {
            a.push_back(v);
        }
    }
    vector<int> b;
    for (int i = 0; i < m; i++) {
        int l, v; cin >> l >> v;
        v--;
        for (int j = 0; j < l; j++) {
            b.push_back(v);
        }
    }
    vector<int> a_pos(k, -1), b_pos(k, -1);
    bool res[N][M];
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < M; j++) {
            res[i][j] = false;
        }
    }
    for (int i = N - 1; i >= 0; i--) {
        for (int j = M - 1; j >= 0; j--) {
            if (a[i] == b[j]) {
                for (int x = 0; x < k; x++) {
                    if (a_pos[x] != -1 && b_pos[x] != -1) {
                        if (!res[a_pos[x]][b_pos[x]]) {
                            res[i][j] = true;
                        }
                    }
                }
            }
            b_pos[b[j]] = j;
        }
        a_pos[a[i]] = i;
    }
    vector<int> vq[N][M];
    for (int op = 0; op < q; op++) {
        int x, y; cin >> x >> y;
        vq[x][y].push_back(op);
    }
    vector<bool> v_res(q, false);
    for (int i = N - 1; i >= 0; i--) {
        a_pos[a[i]] = i;
        for (int j = M - 1; j >= 0; j--) {
            b_pos[b[j]] = j;
            for (int x = 0; x < k; x++) {
                if (a_pos[x] != -1 && b_pos[x] != -1) {
                    if (!res[a_pos[x]][b_pos[x]]) {
                        while (!vq[i][j].empty()) {
                            v_res[vq[i][j].back()] = true;
                            vq[i][j].pop_back();
                        }
                    }
                }
            }
        }
    }
    for (auto i : v_res) {
        if (i) yes();
        else no();
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
}
