#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;

void fast_in_out() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

//#define int long long
#define all(x) (x).begin(), (x).end()
using ll = long long;
using ull = long long;
using ld = long double;
typedef tree<int, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int nmax = 1600, kmax = 1600;
int N, n, M, m, k, q;
pair<int, int> a[nmax], b[nmax];
pair<int, int> A[nmax + 1], B[nmax + 1];
vector<int> colA[kmax], colB[kmax];
map<int, bool> dp[1000000];

int rec1(int x, int y) {
    if (x >= N || y >= M) {
        return 0;
    }
    if (true) {
        auto it = dp[x].find(y);
        if (it != dp[x].end()) {
            return it->second;
        }
    }
    int bla = lower_bound(A, A + n, make_pair(x + 1, -1)) - A - 1;
    int blb = lower_bound(B, B + m, make_pair(y + 1, -1)) - B - 1;
    for (int i = 0; i < k; ++i) {
        if (i != A[bla].second && i != B[blb].second) {
            int blanew = upper_bound(all(colA[i]), bla) - colA[i].begin();
            int blbnew = upper_bound(all(colB[i]), blb) - colB[i].begin();
            if (blanew < (int) colA[i].size() && blbnew < (int) colB[i].size()) {
                blanew = colA[i][blanew];
                blbnew = colB[i][blbnew];
                if (rec1(A[blanew].first + 1, B[blbnew].first + 1) == 0) {
                    dp[x][y] = 1;
                    return 1;
                }
            }
        }
    }
    if (A[bla].second == B[blb].second) {
        if (rec1(x + 1, y + 1) == 0) {
            dp[x][y] = 1;
            return 1;
        } else {
            dp[x][y] = 0;
            return 0;
        }
        int ra = A[bla + 1].first;
        int rb = B[blb + 1].first;
        int len = min(ra - x, rb - y);
        return (len & 1);
    } else {
        for (int i = 0; i < k; ++i) {
            if (i == A[bla].second) {
                int blbnew = upper_bound(all(colB[i]), blb) - colB[i].begin();
                if (blbnew < (int) colB[i].size()) {
                    blbnew = colB[i][blbnew];
                    if (rec1(x + 1, B[blbnew].first + 1) == 0) {
                        dp[x][y] = 1;
                        return 1;
                    }
                }
            }
            if (i == B[blb].second) {
                int blanew = upper_bound(all(colA[i]), bla) - colA[i].begin();
                if (blanew < (int) colA[i].size()) {
                    blanew = colA[i][blanew];
                    if (rec1(A[blanew].first + 1, y + 1) == 0) {
                        dp[x][y] = 1;
                        return 1;
                    }
                }
            }
        }
    }
    dp[x][y] = 0;
    return 0;
}

void solve() {
    cin >> N >> n >> M >> m >> k >> q;
    int pos = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
        --a[i].second;
        colA[a[i].second].emplace_back(i);
        A[i] = {pos, a[i].second};
        pos += a[i].first;
    }
    A[n] = {N, -1};
    pos = 0;
    for (int i = 0; i < m; ++i) {
        cin >> b[i].first >> b[i].second;
        --b[i].second;
        colB[b[i].second].emplace_back(i);
        B[i] = {pos, b[i].second};
        pos += b[i].first;
    }
    B[m] = {M, -1};
    while (q--) {
        int x, y;
        cin >> x >> y;
        cout << (rec1(x, y) ? "Yes\n" : "No\n");
    }
}

signed main() {
    fast_in_out();
    int qwe = 1;
//    cin >> qwe;
    while (qwe--) {
        solve();
    }
    return 0;
}
