// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #pragma GCC target("avx2")

using namespace std;
// using namespace __gnu_pbds;

// #define int long long
// #define ordered_set tree<int, null_type, less<int>, tree_order_statistics_node_update, rb_tree_tag>


void solve() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    int T1 = N - 2000, T2 = M - 2000;
    if (N % 2) T1--; if (M % 2) T2--;
    if (T1 < 0) T1 = 0;
    if (T2 < 0) T2 = 0;
    N -= T1; M -= T2;
    ++k;
    vector<int> a, b;
    for (int i = 0; i < n; ++i) {
        int l, v;
        cin >> l >> v;
        if (i == 0 && l < T1) exit(1);
        if (i == 0) l -= T1;
        for (int i = 0; i < l; ++i) a.push_back(v);
    }
    for (int i = 0; i < m; ++i) {
        int l, v;
        cin >> l >> v;
        if (i == 0 && l < T2) exit(1);
        if (i == 0) l -= T2;
        for (int i = 0; i < l; ++i) b.push_back(v);
    }
    n = N; m = M;
    vector<vector<bool>> dp(n + 1, vector<bool>(m + 1));
    vector<pair<int, int>> lst(k, {-1, -1});
    for (int i = n - 1; i >= 0; --i) {
        lst[a[i]].first = i;
        for (auto &e : lst) e.second = -1;
        int cnt = 0;
        for (int j = m - 1; j >= 0; --j) {
            // cout << i << ' ' << j << endl;
            if (lst[b[j]].first != -1 && lst[b[j]].second != -1) {
                if (!dp[lst[b[j]].first + 1][lst[b[j]].second + 1]) cnt--;
            }
            lst[b[j]].second = j;
            if (lst[b[j]].first != -1 && lst[b[j]].second != -1) {
                if (!dp[lst[b[j]].first + 1][lst[b[j]].second + 1]) cnt++;
            }
            if (cnt) dp[i][j] = 1;
        }
    }
    for (int i = 0; i < q; ++i) {
        int x, y;
        cin >> x >> y;
        x -= T1; y -= T2;
        if (x < 0) x = abs(x) % 2;
        if (y < 0) y = abs(y) % 2;
        if (dp[x][y]) cout << "Yes\n";
        else cout << "No\n";
    }
}

signed main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    solve();
}