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



main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    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];
    for (int i = 0; i < m; i++)
        cin >> lb[i] >> vb[i];
    vector < int > A, B;
    for (int i = 0; i < n; i++) {
        if (i == 0) la[i] = min(la[i], 3);
        for (int j = 0; j < la[i]; j++)
            A.push_back(va[i]);
    }
    for (int i = 0; i < m; i++) {
        if (i == 0) lb[i] = min(lb[i], 3);
        for (int j = 0; j < lb[i]; j++)
            B.push_back(vb[i]);
    }
    N = A.size(); M = B.size();
    vector < vector < int > > pa(N + 1, vector < int > (k + 1, N));
    vector < vector < int > > pb(M + 1, vector < int > (k + 1, M));
    for (int i = N - 1; i >= 0; i--) {
        pa[i] = pa[i + 1];
        pa[i][A[i]] = i;
    }
    for (int i = M - 1; i >= 0; i--) {
        pb[i] = pb[i + 1];
        pb[i][B[i]] = i;
    }
    map < int , map < int , int > > dp;
    function < pair < int , int > (int, int, int) > frst = [&](int K, int l, int r) {
        int L = pa[l + 1][K];
        int R = pb[r + 1][K];
        return make_pair(L, R);
    };
    function < int(int, int) > f = [&](int l, int r) {
        if (dp.find(l + 1) != dp.end() && dp[l + 1].find(r + 1) != dp[l + 1].end()) return dp[l + 1][r + 1];
        for (int K = 1; K <= k; K++) {
            auto [L, R] = frst(K, l, r);
            if (L == N || R == M) continue;
            if (!f(L, R)) {
                return dp[l + 1][r + 1] = 1;
            }
        }
        return dp[l + 1][r + 1] = 0;
    };
    while (q--) {
        int l, r;
        cin >> l >> r;
        l = max(0, l - max(0, la[0] - 3));
        r = max(0, r - max(0, lb[0] - 3));

        if (f(l - 1, r - 1)) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
}
