#include <bits/stdc++.h>
using namespace std;


using ll = long long;
const int inf = 1e9;

struct cool_segtree {
    vector<int> val;
    int n;
    vector<pair<int, int>> tr;

    void add_val(int x) {
        val.push_back(x);
    }

    void build() {
        sort(val.begin(), val.end());
        val.resize(unique(val.begin(), val.end()) - val.begin());
        n = val.size();
        tr.assign(2 * n, {inf, inf});
    }

    int get_val(int x) {
        return lower_bound(val.begin(), val.end(), x) - val.begin();
    }

    void add(int l, int r, pair<int, int> x) {
        l = get_val(l), r = get_val(r) - 1;
        for (l += n, r += n; l <= r; l >>= 1, r >>= 1) {
            if (l & 1) {
                tr[l] = max(tr[l], x);
                l++;
            }
            if (~r & 1) {
                tr[r] = max(tr[r], x);
                r--;
            }
        }
    }

    pair<int, int> get(int k) {
        k = upper_bound(val.begin(), val.end(), k) - val.begin() - 1;
        if (k < 0 || k >= n) return {inf, inf};
        pair<int, int> ret = {inf, inf};
        for (k += n; k; ret = min(ret, tr[k]), k >>= 1);
        return ret;
    }
};


int main() {
    cin.tie(nullptr)->sync_with_stdio(false);

    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> la(n), va(n), lb(m), vb(m);
    for (int i = 0; i < n; ++i) {
        cin >> la[i] >> va[i];
        --va[i];
    }
    for (int i = 0; i < m; ++i) {
        cin >> lb[i] >> vb[i];
        --vb[i];
    }
    vector<vector<int>> nxa(n + 1, vector<int>(k, n)), nxb(m + 1, vector<int>(k, m));
    for (int i = n - 1; i >= 0; --i) {
        nxa[i] = nxa[i + 1];
        nxa[i][va[i]] = i;
    }
    for (int j = m - 1; j >= 0; --j) {
        nxb[j] = nxb[j + 1];
        nxb[j][vb[j]] = j;
    }
    vector<vector<bool>> dp(n, vector<bool>(m));
    vector<cool_segtree> tr(k);
    vector<int> cola(n), colb(n);
    vector<int> alla(k), allb(k);
    for (int i = 0; i < n; ++i) {
        cola[i] = la[i];
        alla[va[i]] += la[i];
        for (int j = i - 1; j >= 0; --j) {
            if (va[j] == va[i]) {
                cola[i] += cola[j];
                break;
            }
        }
    }
    for (int i = 0; i < m; ++i) {
        colb[i] = lb[i];
        allb[vb[i]] += lb[i];
        for (int j = i - 1; j >= 0; --j) {
            if (vb[i] == vb[j]) {
                colb[i] += colb[j];
                break;
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (va[i] != vb[j]) continue;
            tr[va[i]].add_val(colb[j] - lb[j] + 1 - cola[i]);
            tr[va[i]].add_val(colb[j] + la[i] - cola[i]);
        }
    }
    for (int i = 0; i < k; ++i) tr[i].build();
    function<bool(int, int, int, int)> calc = [&](int i, int l1, int j, int l2) -> bool {
        int pj = colb[j] - l2, pi = cola[i] - l1;
        int delt = pj - pi;
        auto [x, y] = tr[va[i]].get(delt);
        x = min(x, n), y = min(y, m);
        if (x < n && y < m) {
            int d1 = cola[x] - la[x] + 1 - pi;
            int d2 = colb[y] - lb[y] + 1 - pj;
            return ~max(d1, d2) & 1;
        } else {
            int d1 = alla[va[i]] - pi;
            int d2 = allb[vb[j]] - pj;
            return min(d1, d2) & 1;
        }
    };
    vector<vector<vector<tuple<int, int, int>>>> que(n, vector<vector<tuple<int, int, int>>>(m));
    vector<int> prefa(n);
    partial_sum(la.begin(), la.end(), prefa.begin());
    vector<int> prefb(m);
    partial_sum(lb.begin(), lb.end(), prefb.begin());
    vector<bool> ans(q);
    for (int id = 0; id < q; ++id) {
        int x, y;
        cin >> x >> y;
        int i = upper_bound(prefa.begin(), prefa.end(), x) - prefa.begin();
        int j = upper_bound(prefb.begin(), prefb.end(), y) - prefb.begin();
        x = prefa[i] - x;
        y = prefb[j] - y;
        que[i][j].emplace_back(x, y, id);
    }
    for (int i = n - 1; i >= 0; --i) {
        int cnt = 0;
        for (int j = m - 1; j >= 0; --j) {
            if (va[i] == vb[j]) {
                if (cnt > 0) {
                    tr[va[i]].add(colb[j] - lb[j] + 1 - cola[i], colb[j] + la[i] - cola[i], {i, j});
                }
                dp[i][j] = calc(i, la[i] - 1, j, lb[j] - 1);
                for (auto [x, y, id] : que[i][j]) {
                    ans[id] = calc(i, x, j, y);
                }
            } else {
                int c = vb[j];
                if (j + 1 < m) cnt -= nxa[i][c] < n && nxb[j + 1][c] < m && !dp[nxa[i][c]][nxb[j + 1][c]];
                cnt += nxa[i][c] < n && nxb[j][c] < m && !dp[nxa[i][c]][nxb[j][c]];
            }
        }
    }
    for (auto i : ans) {
        if (i) cout << "Yes\n";
        else cout << "No\n";
    }
    return 0;
}

/*
10 6 10 9 3 1
1 3
3 1
2 2
1 3
1 1
2 3
1 1
1 2
1 1
1 2
1 3
1 1
2 2
1 3
1 2
3 2
 */