#include <bits/stdc++.h>

using namespace std;
using ll = long long;

mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const ll NN = 1600 + 5;
ll N, n, M, m, k, q;

ll la[NN], lb[NN], va[NN], vb[NN];

ll nx_a[NN], nx_b[NN];

unordered_map<ll, bool> qp;
ll GG = NN;

bool dfs(ll pos_a, ll pos_b) {
    ll sum = 0;
    ll len1 = -1;
    for (int i = 0; i < n; ++i) {
        sum += la[i];
        if (sum > pos_a) {
            len1 = sum - pos_a;
            break;
        }
    }
    sum = 0;
    ll len2 = -1;
    for (int i = 0; i < m; ++i) {
        sum += lb[i];
        if (sum > pos_b) {
            len2 = sum - pos_b;
            break;
        }
    }
    if (len1 == -1 || len2 == -1) {
        return false;
    }
    ll hash = pos_a + pos_b * (ll) 2e9;
    auto u = qp.find(hash);
    if (u != qp.end()) {
        return u->second;
    }
    for (int i = 0; i <= k; ++i) {
        nx_a[i] = nx_b[i] = -1;
    }
    sum = 0;
    unordered_set<ll> yep;
    for (int i = 0; i < n; ++i) {
        sum += la[i];
        if (nx_a[va[i]] == -1 && sum > pos_a) {
            nx_a[va[i]] = max(pos_a + 1, sum - la[i] + 1);
            yep.insert(va[i]);
        }
    }
    sum = 0;
    for (int i = 0; i < m; ++i) {
        sum += lb[i];
        if (nx_b[vb[i]] == -1 && sum > pos_b) {
            nx_b[vb[i]] = max(pos_b + 1, sum - lb[i] + 1);
            yep.insert(vb[i]);
        }
    }
    vector<pair<ll, ll>> e;
    for (int i: yep) {
        if (nx_a[i] != -1 && nx_b[i] != -1) {
            e.emplace_back(nx_a[i], nx_b[i]);
        }
    }
    std::shuffle(e.begin(), e.end(), rnd);
    for (int i = 0; i < (ll) e.size() && i < GG; ++i) {
        if (!dfs(e[i].first, e[i].second)) {
            return qp[hash] = true;
        }
    }
    return qp[hash] = false;
}

void solve() {
    cin >> N >> n >> M >> m >> k >> q;
    if (N * M >= 100000) {
    }
    for (int i = 0; i < n; ++i) {
        cin >> la[i] >> va[i];
    }
    for (int i = 0; i < m; ++i) {
        cin >> lb[i] >> vb[i];
    }
    for (int i = 0; i < q; ++i) {
        ll x, y;
        cin >> x >> y;
        if (dfs(x, y)) {
            cout << "Yes" << '\n';
        } else {
            cout << "No" << '\n';
        }
    }
}

int main() {
    int test = 1;
    // cin >> test;
    while (test--) {
        solve();
    }
}
