#include <bits/stdc++.h>
#include <random>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
using ll = long long;

template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

//int new_tnode(ll x, int tl, int tr, int l = 0, int r = 0);

template<class T>
struct TNode {
    T x;
    int tl, tr;
    int l = 0;
    int r = 0;
    T def;
    function<T(T, T)> sum;

    TNode(T x, T def, function<T(T, T)> sum, int tl, int tr, int l = 0, int r = 0) :
            x(x), def(def), sum(sum), tl(tl), tr(tr), l(l), r(r) {

    }
    // TNode() = default;
    TNode get_l() const {
        return l ? l : TNode<T>(def, tl, (tl + tr) / 2);
    }
    TNode get_r() const {
        return r ? r : TNode<T>(def, (tl + tr) / 2, tr);
    }

    T get(int ll, int rr) {
        if (tr <= ll || rr <= tl) return def;
        if (ll <= tl && tr <= rr) return x;
        return sum(get_l().get(ll, rr), get_r().get(ll, rr));
    }

    void insert(int i, T y) {
        if (tl == i && i + 1 == tr) {
            x = y;
        }
        int tm = (tl + tr) / 2;
        if (i < tm) {
            get_l().insert(i, y);
        } else {
            get_r().insert(i, y);
        }
        x = sum(get_l().x, get_r().x);
    }

};

//vector<TNode> tn(1);

//int new_tnode(ll x, int tl, int tr, int l, int r) {
//    tn.emplace_back(x, tl, tr, l, r);
//    return (int) tn.size() - 1;
//}

//template<class T>
//struct Tree {
//    TNode<T> root;
//    int n, N;
//    T def;
//    function<T(T, T)> sum;
//    Tree(int n, T def, function<T(T, T)> sum): n(n), def(def), sum(sum) {
//        int st = 0;
//        while ((1 << st) < n) ++st;
//        N = (1 << st);
//        root = TNode<T>(def, sum, 0, N);
//    }
//};

#define int ll

void solve() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<pair<int, int>> va(n), vb(m);
    vector<int> cnta(k);
    vector<int> cntb(k);
    for (int i = 0; i < n; ++i) {
        int l, a;
        cin >> l >> a;
        --a;
        cnta[a] += l;
        va[i] = {l, a};
    }
    for (int i = 0; i < m; ++i) {
        int l, a;
        cin >> l >> a;
        --a;
        cntb[a] += l;
        vb[i] = {l, a};
    }
    for (int qq = 0; qq < q; ++qq) {
        int x0, y0;
        cin >> x0 >> y0;
        int x = x0, y = y0;
        int i = 0, j = 0;
        while (x >= va[i].first) {
            x -= va[i].first;
            cnta[va[i].second] -= va[i].first;
            i++;
        }
        while (y >= vb[j].first) {
            y -= vb[j].first;
            cntb[vb[j].second] -= vb[j].first;
            j++;
            if (j >= m && y != 0) {
                while(true);
            }
        }
        if (i < n) cnta[va[i].second] -= x;
        if (j < m) cntb[vb[j].second] -= y;
        bool ok = false;
        for (int l = 0; l < k; ++l) {
            if (min(cnta[l], cntb[l]) % 2 == 1) {
                ok = true;
            }
        }
        cout << (ok ? "YES" : "NO") << '\n';
        if (i < n) cnta[va[i].second] += x;
        if (j < m) cntb[vb[j].second] += y;
        while (i != 0) {
            --i;
            cnta[va[i].second] += va[i].first;
        }
        while (j != 0) {
            j--;
            cntb[vb[j].second] += vb[j].first;
        }
    }
}

signed main() {
    int t = 1;
//    cin >> t;
    for (int test = 0; test < t; ++test) {
        solve();
        cout << '\n';
    }
    cerr << clock() / 1000.0;
    return 0;
}
