#include <bits/stdc++.h>


using namespace std;


template<typename T>
ostream & operator <<(ostream &os, const vector<T> &a) {
    for (T el : a) {
        os << el << " ";
    }
    os << '\n';
    return os;
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> a;
    vector<int> b;
    for (int i = 0; i < n; i++) {
        int l, u;
        cin >> l >> u;
        for (int j = 0; j < l; j++) {
            a.push_back(u);
        }
    }
    for (int i = 0; i < m; i++) {
        int l, u;
        cin >> l >> u;
        for (int j = 0; j < l; j++) {
            b.push_back(u);
        }
    }
    vector<vector<bool>> win(N + 2, vector<bool>(M + 2, 0));
    win.at(N + 1).at(M + 1) = 1;
    for (int i = N - 1; i >= 0; i--) {
        vector<pair<int, int>> ch(k + 1, {N, M});
        for (int j = M - 1; j >= 0; j--) {
            for (int pos = N - 1; pos >= i; pos--) {
                if (a.at(pos) == b.at(j)) {
                    ch.at(a.at(pos)) = {pos, j};
                }
            }
            for (int c = 1; c <= k && !win.at(i).at(j); c++) {
                auto to = ch.at(c);
                int row = to.first + 1;
                int col = to.second + 1;
                win.at(i).at(j) = win.at(i).at(j) || !(win.at(row).at(col));
            }
        }
    }
    for (int i = 0; i < q; i++) {
        int x, y;
        cin >> x >> y;
        if (win.at(x).at(y)) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
    return 0;
}


/*7 3 7 3 2 12
2 1
3 2
2 1
2 2
3 1
2 2
0 2
0 3
0 4
1 2
1 3
1 4
2 5
2 6
3 5
3 6
4 5
4 6*/


/*5 1 5 1 1 1
5 1
5 1
1 1*/


/*5 1 5 1 1 9
5 1
5 1
0 0
0 1
0 2
1 0
1 1
1 2
2 0
2 1
2 2*/
