#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<pair<int, int>> a(n);
    vector<int> cnta = {0};
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
        a[i].second--;
        cnta.push_back(cnta.back() + a[i].first);
    }
    vector<vector<int>> nexta(n, vector<int> (k, n));
    for (int i = n - 2; i >= 0; --i) {
        nexta[i] = nexta[i + 1];
        nexta[i][a[i + 1].second] = i + 1;
    }
    vector<pair<int, int>> b(m);
    vector<int> cntb = {0};
    for (int i = 0; i < m; ++i) {
        cin >> b[i].first >> b[i].second;
        b[i].second--;
        cntb.push_back(cntb.back() + b[i].first);
    }
    vector<vector<int>> nextb(n, vector<int> (k, m));
    for (int i = m - 2; i >= 0; --i) {
        nextb[i] = nextb[i + 1];
        nextb[i][b[i + 1].second] = i + 1;
    }
    vector<pair<int, int>> to_cnt;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (a[i].second == b[j].second) {
                to_cnt.push_back({i, j});
            }
        }
    }
    vector<vector<int>> dp(n + 1, vector<int> (m + 1, -1));
    vector<vector<int>> dp2(n + 1, vector<int> (m + 1, -1));
    for (int i = 0; i <= n; ++i) {
        dp[i][m] = 1;
        dp2[i][m] = 1;
    }
    for (int i = 0; i <= m; ++i) {
        dp[n][i] = 1;
        dp2[n][i] = 1;
    }
    sort(to_cnt.rbegin(), to_cnt.rend());
    for (auto [i, j] : to_cnt) {
        int now = 1;
        for (int y = 0; y < k; ++y) {
            if (a[i].second != y) {
                int x1 = nexta[i][y];
                int x2 = nextb[j][y];
                //cout << i << " " << j << " " << x1 << " " << x2 << endl;
                now &= dp[x1][x2];
            }
        }
        dp2[i][j] = now;
        if (!now) {
            dp[i][j] = 1;
        } else {
            int u = min(a[i].first, b[j].second) - 1;
            dp[i][j] = u % 2;
        }
        //cout << i << " " << j << " " << dp[i][j] << " " << dp2[i][j] << endl;
    }
    for (int _ = 0; _ < q; ++_) {
        int x, y;
        cin >> x >> y;
        int i = upper_bound(cnta.begin(), cnta.end(), x) - cnta.begin();
        int j = upper_bound(cntb.begin(), cntb.end(), y) - cntb.begin();
        --i; --j;
        //cout << i << " " << j << " " << dp[i][j] << " " << dp2[i][j] << endl;
        int now = dp2[i][j];
        int t = 0;
        if (!now) {
            t = 1;
        } else {
            int u = min(a[i].first - (x - cnta[i]), b[j].first - (y - cntb[j]));
            t = u % 2;
        }
        if (t) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}
