// i must be the reason why
// you have given up your smiles
// and the hope inside your life has been stolen
// i must be the reason why
// you have told me all these lies
// that i will lead a happier life without you by my side
// дальше текст забыл

// t.me/truebaza <---- лучший тг канал
// t.me/truebaza <---- лучший тг канал
// t.me/truebaza <---- лучший тг канал
// t.me/truebaza <---- лучший тг канал
// t.me/truebaza <---- лучший тг канал
// t.me/truebaza <---- лучший тг канал
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define fastio cin.tie(0), ios_base::sync_with_stdio(false)
#define all(x) (x).begin(), (x).end()
#define INF ((1ll << 29) - 1)

map<array<int, 4>, bool> mp;
vector<pair<int, int>> a;
vector<pair<int, int>> b;
vector<int> kek[1601];
vector<int> kek2[1601];
vector<int> there;
int k;
bool rec(int i, int ca, int j, int cb) {
    if (i == 1 && ca == 1 && j == 2 && cb == 1) {
        int kke = 2;
    }
    if (mp.find({i, ca, j, cb}) != mp.end()) {
        return mp[{i, ca, j, cb}];
    }
    if (a[i].first > ca && b[j].first > cb && !rec(i, ca + 1, j, cb + 1)) {
        return mp[{i, ca, j, cb}] = true;
    }
    for (auto v : there) {
        if (v != a[i].second) {
            auto ia = lower_bound(all(kek[v]), i);
            auto ib = lower_bound(all(kek2[v]), j);
            if (ia != kek[v].end() && ib != kek2[v].end() && !rec(*ia, 1, *ib, 1)) {
                return mp[{i, ca, j, cb}] = true;
            }
        } else {
            auto ia = lower_bound(all(kek[v]), i);
            auto ib = lower_bound(all(kek2[v]), j);
            int na = ca + 1, nb = cb + 1;
            if (a[i].first == ca) ia = upper_bound(all(kek[v]), i), na = 1;
            if (b[j].first == cb) ib = upper_bound(all(kek2[v]), j), nb = 1;
            if (ia != kek[v].end() && ib != kek2[v].end() && !rec(*ia, na, *ib, nb)) {
                return mp[{i, ca, j, cb}] = true;
            }
        }
    }
    return mp[{i, ca, j, cb}] = false;
}

auto main() -> signed { // t.me/truebaza <---- лучший тг канал
    fastio;
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    a.resize(n), b.resize(m);
    vector<int> psza, pszb;
    for (auto& i : a) cin >> i.first >> i.second, there.push_back(i.second);
    for (auto& i : b) cin >> i.first >> i.second, there.push_back(i.second);
    for (int i = 0; i < n; ++i) {
        kek[a[i].second].push_back(i);
    }
    for (int i = 0; i < m; ++i) {
        kek2[b[i].second].push_back(i);
    }
    sort(all(there));
    there.erase(unique(all(there)), there.end());
    int pref = 0;
    for (auto i : a) {
        pref += i.first;
        psza.push_back(pref);
    }
    pref = 0;
    for (auto i : b) {
        pref += i.first;
        pszb.push_back(pref);
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        int i, ca, j, cb;
        {
            auto it = upper_bound(all(psza), x);
            i = it - psza.begin();
            ca = (x - (i > 0 ? psza[i - 1] : 0));
        }
        {
            auto it = upper_bound(all(pszb), y);
            j = it - pszb.begin();
            cb = (y - (j > 0 ? pszb[j - 1] : 0));
        }
        if (rec(i, ca, j, cb)) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
}