#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<stack>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>

using namespace std;
using ll = long long int;
using ld = long double;

void solve() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> a, b;
    vector<vector<int>> ind1(k + 1);
    vector<vector<int>> ind2(k + 1);
    vector<int> diff;
    for (int i = 0; i < n; ++i) {
        int kol, val;
        cin >> kol >> val;
        diff.push_back(val);
        for (int j = 0; j < kol; ++j) {
            a.push_back(val);
            ind1[val].push_back((int)a.size() - 1);
        }
    }
    for (int i = 0; i < m; ++i) {
        int kol, val;
        cin >> kol >> val;
        diff.push_back(val);
        for (int j = 0; j < kol; ++j) {
            b.push_back(val);
            ind2[val].push_back((int)b.size() - 1);
        }
    }
    sort(diff.begin(), diff.end());
    diff.erase(unique(diff.begin(), diff.end()), diff.end());
    vector<vector<int>> dp(N, vector<int>(M, 0));
    k = diff.size();
    for (int i = N - 1; i > -1; --i) {
        for (int j = M - 1; j > -1; --j) {
            bool t = false;
            for (int last = 0; last < k; ++last) {
                int el = diff[last];
                int i1 = lower_bound(ind1[el].begin(), ind1[el].end(), i) - ind1[el].begin();
                int j1 = lower_bound(ind2[el].begin(), ind2[el].end(), j) - ind2[el].begin();
                if ((i1 == ind1[el].size()) || (j1 == ind2[el].size())) {
                    continue;
                } else {
                    if ((i1 == (int)ind1[el].size() - 1) || (j1 == (int)ind2[el].size() - 1)) {
                        t = true;
                        break;
                    } else {
                        if (dp[ind1[el][i1 + 1]][ind2[el][j1 + 1]] == 0) {
                            t = true;
                            break;
                        }
                    }
                }
            }
            dp[i][j] = t;
        }
    }
    /*for (int i = 0; i < N; ++i) {
        for (int j = 0; j < M; ++j) {
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/
    for (int _ = 0; _ < q; ++_) {
        int i, j;
        cin >> i >> j;
        if (dp[i][j]) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int tt = 1;
    while (tt--) {
        solve();
    }
}