#include <bits/stdc++.h>

using namespace std;

map<pair<int, int>, bool> cache;
vector<int> vals;

map<int, vector<pair<int, int>>> A[2];
int sz[2] = {0, 0};


int find_next_pos(int i, int pos, int want) {
    if (A[i][want].empty()) return -1;
    auto it = lower_bound(A[i][want].begin(), A[i][want].end(), pair<int, int>{pos + 1, -1});
    if (it != A[i][want].begin() && prev(it)->second > pos) --it;
    if (it != A[i][want].end() && it->second <= pos) ++it;
    if (it == A[i][want].end()) return -1;
    return max(pos + 1, it->first);
}

bool solve(int x, int y) {
    if (cache.contains({x, y})) {
        return cache[{x, y}];
    }
    bool good = false;
    for (int v: vals) {
        int xnew = find_next_pos(0, x, v);
        int ynew = find_next_pos(1, y, v);
        if (xnew != -1 && ynew != -1 && !solve(xnew, ynew)) {
            good = true;
            break;
        }
    }
    return cache[{x, y}] = good;
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);


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

    for (int i = 0; i < n; i++) {
        int l, v;
        cin >> l >> v;
        A[0][v].emplace_back(sz[0], sz[0] + l - 1);
        sz[0] += l;
        vals.push_back(v);
    }

    for (int i = 0; i < m; i++) {
        int l, v;
        cin >> l >> v;
        A[1][v].emplace_back(sz[1], sz[1] + l - 1);
        sz[1] += l;
        vals.push_back(v);
    }

    sort(vals.begin(), vals.end());
    vals.erase(unique(vals.begin(), vals.end()), vals.end());

    while (q--) {
        int x, y;
        cin >> x >> y;
        cout << (solve(x, y) ? "No" : "Yes") << "\n";
    }
    return 0;
}