#include <bits/stdc++.h>

#pragma GCC optimize("O3")
using namespace std;

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

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


pair<int, int> find_next_pos(int i, int pos, int want) {
    if (A[i][want].empty()) return {-1, 0};
    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, 0};
    int p = max(pos + 1, it->first);
    return {p, it->second - p};
}

bool solve(int x, int y) {
    if (cache.contains({x, y})) {
        return cache[{x, y}];
    }
    bool good = false;
    for (int v: vals) {
        auto [xnew, x_can_add] = find_next_pos(0, x, v);
        if (xnew == -1) continue;
        auto [ynew, y_can_add] = find_next_pos(1, y, v);
        if (ynew == -1) continue;
        int t = min(x_can_add, y_can_add);
        if (t % 2 == 1) t--;
        if (!solve(xnew + t, ynew + t)) {
            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;

    set<int> vals1, vals2;
    for (int i = 0; i < n; i++) {
        int l, v;
        cin >> l >> v;
        A[0][v].emplace_back(sz[0], sz[0] + l - 1);
        vals_a.emplace_back(sz[0], v);
        sz[0] += l;
        vals1.insert(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;
        vals2.insert(v);
    }
    for (int x: vals1) {
        if (vals2.contains(x)) {
            vals.push_back(x);
        }
    }

    while (q--) {
        int x, y;
        cin >> x >> y;
        if (!solve(x, y)) {
            cout << "Yes\n";
            continue;
        }
        int skip = prev(lower_bound(vals_a.begin(), vals_a.end(), pair<int, int>{x + 1, -1}))->second;
        bool good = false;
        for (int v: vals) {
            if (v == skip) continue;
            auto [xnew, x_can_add] = find_next_pos(0, x, v);
            if (xnew == -1) continue;
            auto [ynew, y_can_add] = find_next_pos(1, y, v);
            if (ynew == -1) continue;
            int t = min(x_can_add, y_can_add);
            if (t % 2 == 1) t--;
            if (!solve(xnew + t, ynew + t)) {
                good = true;
                break;
            }
        }
        cout << (good ? "Yes" : "No") << "\n";
    }
    return 0;
}