#include <bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<array<int, 2>> a(n), b(m);
    for (auto& [l, x] : a) {
        cin >> l >> x;
        x--;
    }
    for (auto& [l, x] : b) {
        cin >> l >> x;
        x--;
    }
    vector<int> apref(n), bpref(m);
    apref[0] = a[0][0], bpref[0] = b[0][0];
    for (int i = 1; i < n; i++) {
        apref[i] = apref[i - 1] + a[i][0];
    }
    for (int i = 1; i < m; i++) {
        bpref[i] = bpref[i - 1] + b[i][0];
    }
    vector<vector<int>> asuff(k, vector<int>(n));
    for (int x = 0; x < k; x++) {
        for (int i = n - 1; i >= 0; i--) {
            if (i + 1 < n) {
                asuff[x][i] = asuff[x][i + 1];
            }
            if (a[i][1] == x) asuff[x][i] += a[i][0];
        }
    }
    vector<vector<int>> bsuff(k, vector<int>(m));
    for (int x = 0; x < k; x++) {
        for (int i = m - 1; i >= 0; i--) {
            if (i + 1 < m) {
                bsuff[x][i] = bsuff[x][i + 1];
            }
            if (b[i][1] == x) bsuff[x][i] += b[i][0];
        }
    }
    vector<vector<int>> dp(n, vector<int>(m));
    vector<vector<int>> raw(n, vector<int>(m));
    vector<int> par(m, -1);
    for (int i = n - 1; i >= 0; i--) {
        vector<int> wins(k);
        int sum = 0;
        for (int j = m - 1; j >= 0; j--) {
            if (a[i][1] == b[j][1]) {
                dp[i][j] = raw[i][j] = sum > 0;
                if (dp[i][j] == 0) {
                    int x = a[i][1];
                    int cnt = min(asuff[x][i], bsuff[x][j]);
                    if (cnt % 2 == 1) {
                        dp[i][j] = 1;
                    }
                }
                par[j] = i;
            } else {
                if (par[j] != -1) {
                    sum -= wins[b[j][1]];
                    wins[b[j][1]] = dp[par[j]][j];
                    sum += wins[b[j][1]];
                }
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            // cout << i << " " << j << ": " << dp[i][j] << "\n";
        }
    }
    for (int i = 0; i < q; i++) {
        int x, y;
        cin >> x >> y;
        auto ita = lower_bound(apref.begin(), apref.end(), x + 1) - apref.begin();
        auto itb = lower_bound(bpref.begin(), bpref.end(), y + 1) - bpref.begin();
        bool win = raw[ita][itb];
        int val = a[ita][1];
        if (!win) {
            int abefore = 0;
            if (ita > 0) abefore = apref[ita - 1];
            int bbefore = 0;
            if (itb > 0) bbefore = bpref[itb - 1];
            int cnt = min(asuff[val][ita] - (x - abefore), bsuff[val][itb] - (y - bbefore));
            // cout << cnt << "\n";
            if (cnt % 2 == 1) {
                win = true;
            }
        }
        if (win) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
}