#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
        tree_order_statistics_node_update>;
template<class T> using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag,
        tree_order_statistics_node_update>;

#define int long long


signed main() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> la(n), va(n), a, b;
    vector<vector<int>> a1(k + 1);
    int curr_a = 0;
    vector<int> ev;
    for (int i = 0; i < n; ++i) {
        cin >> la[i] >> va[i];
        ev.push_back(va[i]);
        for (int j = 0; j < la[i]; ++j) {
            a.push_back(va[i]);
            a1[va[i]].push_back(curr_a++);
        }
    }
    vector<int> lb(m), vb(m);
    int curr_b = 0;
    vector<vector<int>> b1(k + 1);
    for (int i = 0; i < m; ++i) {
        cin >> lb[i] >> vb[i];
        for (int j = 0; j < lb[i]; ++j) {
            b.push_back(vb[i]);
            b1[vb[i]].push_back(curr_b++);
        }
    }
    for (int i = 1; i <= k; ++i) {
        b1[i].push_back(M);
        a1[i].push_back(N);
    }
    vector<vector<int>> dp(N + 1, vector<int>(M + 1));
    for (int i = N - 1; i >= 0; --i) {
        for (int j = M - 1; j >= 0; --j) {
            if (a[i] != b[j]) {
                continue;
            }
            if (i == N - 1 || j == M - 1) {
                dp[i][j] = 0;
            }
            for (auto to: va) {
                int nxt_a = *upper_bound(a1[to].begin(), a1[to].end(), i);
                int nxt_b = *upper_bound(b1[to].begin(), b1[to].end(), j);
                if (nxt_a < N && nxt_b < M) {
                    if (dp[nxt_a][nxt_b] == 0) {
                        dp[i][j] = 1;
                        break;
                    }
                }
            }
        }
    }
    for (int tst = 0; tst < q; ++tst) {
        int x, y;
        cin >> x >> y;
        int fl = 0;
        for (auto to: ev) {
            auto inda = *lower_bound(a1[to].begin(), a1[to].end(), x);
            auto indb = *lower_bound(b1[to].begin(), b1[to].end(), y);
            if (inda != N && indb != M) {
                if (dp[inda][indb] == 0) {
                    fl = 1;
                }
            }
        }
        if (fl) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
    return 0;
}
