#include <bits/stdc++.h>

using namespace std;

int n, b1, m, b2, k, q;
vector<vector<int>> to1, to2;
vector<vector<int>> mp;

bool get(int x, int y) {
    if (x >= n || y >= m) return false;
    if (mp[x][y] != -1) return mp[x][y];
    for (int i = 0; i < k; i++) {
        if (to1[x][i] != n && to2[y][i] != m && !get(to1[x][i] + 1, to2[y][i] + 1))
            return mp[x][y] = true;
    }
    return mp[x][y] = false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> b1 >> m >> b2 >> k >> q;
    vector<int> vec1, vec2;
    while (b1--) {
        int l, v;
        cin >> l >> v;
        vec1.resize(vec1.size() + l, --v);
    }
    while (b2--) {
        int l, v;
        cin >> l >> v;
        vec2.resize(vec2.size() + l, --v);
    }
    to1.resize(n + 1, vector<int> (k, n));
    for (int i = n - 1; i >= 0; i--) {
        to1[i] = to1[i + 1];
        to1[i][vec1[i]] = i;
    }
    to2.resize(m + 1, vector<int> (k, m));
    for (int i = m - 1; i >= 0; i--) {
        to2[i] = to2[i + 1];
        to2[i][vec2[i]] = i;
    }
    mp.assign(n, vector<int> (m, -1));
    while (q--) {
        int x, y;
        cin >> x >> y;
        if (get(x, y)) cout << "Yes\n";
        else cout << "No\n";
    }
}
