#include <iostream>

#include <vector>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector <int> a(n);
    vector <int> aa(n);
    vector <int> b(m);
    vector <int> bb(m);
    for (int i = 0; i < n; i++) {
        cin >> aa[i] >> a[i];
    }
    for (int i = 0; i < m; i++) {
        cin >> bb[i] >> b[i];
    }
    vector <int> posa(k + 1, 0);
    vector <int> posb(k + 1, 0);
    for (int i = 0; i < n; i++) {
        posa[a[i]]++;
    }
    for (int i = 0; i < m; i++) {
        posb[b[i]]++;
    }
    vector <int> pos;
    for (int i = 1; i <= k; i++) {
        if (posa[i] && posb[i]) {
            pos.push_back(i);
        }
    }
    //return 0;
    int kk = pos.size();
    vector <int> xxx(k + 1, 0);
    for (int i = 0; i < kk; i++) {
        xxx[pos[i]] = i;
    }
    vector <vector <int>> xa(kk);
    vector <vector <int>> xb(kk);
    vector <int> last_a(k + 1);
    vector <int> last_b(k + 1);
    for (int i = 0; i < n; i++) {
        if (posb[a[i]]) {
            xa[xxx[a[i]]].push_back(i);
            last_a[a[i]] = i;
        }
    }
    //return 0;
    for (int i = 0; i < m; i++) {
        if (posa[b[i]]) {
            xb[xxx[b[i]]].push_back(i);
            last_b[b[i]] = i;
        }
    }
    //return 0;
    vector <vector <int>> dp(n, vector <int>(n, 0));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (a[i] == b[j]) {
                for (int p : pos) {
                    if (p != a[i]) {
                        if ((last_a[p] > i && last_b[p] < j) || (last_a[p] < i && last_b[p] > j)) {
                            dp[i][j] = 1;
                            break;
                        }
                        if (last_a[p] > i && last_b[p] > j) {
                            int ii = 0, jj = 0;
                            while (xa[p][ii] < i) {
                                ii++;
                            }
                            while (xb[p][jj] < j) {
                                jj++;
                            }
                            if (min(aa[ii], bb[jj] % 2) == 0 && dp[ii][jj] == 0) {
                                dp[i][j] = 1;
                                break;
                            }
                        }
                    }
                }
            }
        }
    }
    int xi, yi;
    for (int w = 0; w < q; w++) {
        cin >> xi >> yi;
        int ii = 0, jj = 0, ia = 0, ib = 0;
        while (ia <= xi) {
            ia += aa[ii];
            ii++;
        }
        while (ib <= yi) {
            ib += bb[jj];
            jj++;
        }
        ii--;
        jj--;
        int ta = ia - xi, tb = ib - yi;
        if (min(ta, tb) % 2) {
            cout << "Yes" << '\n';
        } else {
            if (dp[ii][jj]) {
                cout << "Yes" << '\n';
            } else {
                cout << "No" << '\n';
            }
        }
    }
    return 0;
}
