#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ve vector
#define pb push_back
ll const inf = 1e9 + 3;

ll const INF = 1e18;

struct Node {
    ll val = 0;
    ll added = 0;
    bool is_added = false;
};

ve<ll> tin_t;
ve<ll> tout_t;
ve<ll> t;


ve<ve<ll>> edges;
ve<ll> depth;
ve<bool> used;

int main() {
#ifdef DEBUG_Q
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n, m, i, j, k, N, M, q;
    cin >> N >> n >> M >> m >> k >> q;
    ll la[n];
    ll cola[n];
    ll lb[m];
    ll colb[m];
    ll a[N];
    ll b[M];
    ll ind = 0;
    for (i = 0; i < n; i++) {
        cin >> la[i] >> cola[i];
    }
    for (i = 0; i < m; i++) {
        cin >> lb[i] >> colb[i];
    }
    for (i = 0; i < n; i++) {
        for (j = 0; j < la[i]; j++) {
            a[ind++] = cola[i] - 1;
        }
    }
    ind = 0;
    for (i = 0; i < m; i++) {
        for (j = 0; j < lb[i]; j++) {
            b[ind++] = colb[i] - 1;
        }
    }
    bool dp[N][M];
    for (i = 0; i < N; i++) {
        for (j = 0; j < M; j++) {
            dp[i][j] = false;
        }
    }
    for (i = N - 1; i >= 0; i--) {
        if (a[i] == b[M - 1]) {
            dp[i][M - 1] = true;
        }
    }
    for (i = 0; i < M; i++) {
        if (b[i] == a[N - 1]) {
            dp[N - 1][i] = true;
        }
    }
    ll last_top[k];
    for (i = 0; i < k; i++) {
        last_top[i] = -1;
    }
    last_top[a[N - 1]] = N - 1;
    for (i = N - 2; i >= 0; i--) {
        ll last_bot[k];
        for (j = 0; j < k; j++) {
            last_bot[j] = -1;
        }
        last_top[a[i]] = i;
        last_bot[b[M - 1]] = M - 1;
        for (j = M - 2; j >= 0; j--) {
            last_bot[b[j]] = j;
            bool bl = false;
            for (ll x = 0; x < k; x++) {
                if ((last_bot[x] + 1 >= M && last_top[x] != -1) || (last_top[x] + 1 >= N && last_bot[x] != -1)) {
                    bl = true;
                    break;
                } else {
                    if (last_bot[x] != -1 && last_top[x] != -1) {
                        if (!dp[last_top[x] + 1][last_bot[x] + 1]) {
                            bl = true;
                            break;
                        }
                    }
                }
            }
            dp[i][j] = bl;
        }
    }
    while (q--) {
        ll x, y;
        cin >> x >> y;
        if (dp[x][y])
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
}
