#include <bits/stdc++.h>

using namespace std;

#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

using ll = long long;

//#define int long long

const int MAX = 5000 + 7;

int N, n, M, m, k, q;
bool win[MAX][MAX];
int a[MAX];
int b[MAX];
int nxta[MAX][1601];
int nxtb[MAX][1601];

int cntlose = 0;
int last[MAX];

int lia[MAX], via[MAX];
int lib[MAX], vib[MAX];

void solve() {
    cin >> N >> n >> M >> m >> k >> q;
    for (int i = 1; i <= N; i++) {
        for (int j = 1; j <= M; j++) {
            win[i][j] = -1;
        }
    }
    for (int i = 1; i <= n; i++) {
        cin >> lia[i] >> via[i];
    }
    for (int i = 1; i <= m; i++) {
        cin >> lib[i] >> vib[i];
    }
    int now = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = now + 1; j <= now + lia[i]; j++) {
            a[j] = via[i];
        }
        now += lia[i];
    }
    N = now;
    now = 0;
    for (int i = 1; i <= m; i++) {
        for (int j = now + 1; j <= now + lib[i]; j++) {
            b[j] = vib[i];
        }
        now += lib[i];
    }
    M = now;
    for (int i = N; i >= 1; i--) {
        for (int j = 1; j <= k; j++) {
            nxta[i][j] = nxta[i + 1][j];
        }
        nxta[i][a[i]] = i;
    }
    for (int i = M; i >= 1; i--) {
        for (int j = 1; j <= k; j++) {
            nxtb[i][j] = nxtb[i + 1][j];
        }
        nxtb[i][b[i]] = i;
    }
    for (int i = 1; i <= k; i++) {
        last[i] = -1;
    }
    for (int i = N; i >= 1; i--) {
        for (int j = 1; j <= k; j++) {
            last[j] = -1;
        }
        cntlose = 0;
        for (int j = M; j >= 1; j--) {
            if (a[i] != b[j]) {
                if (nxta[i + 1][b[j]]) {
                    cntlose -= (last[b[j]] == 0);
                    last[b[j]] = win[nxta[i + 1][b[j]]][j];
                    cntlose += (last[b[j]] == 0);
                }
                continue;
            }
            win[i][j] = (cntlose > 0);
            if (nxta[i + 1][b[j]]) {
                cntlose -= (last[b[j]] == 0);
                last[b[j]] = win[nxta[i + 1][b[j]]][j];
                cntlose += (last[b[j]] == 0);
            }
        }
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        x++;
        y++;
        bool can = false;
        for (int to = 1; to <= k; to++) {
            if (!nxta[x][to]) continue;
            if (!nxtb[y][to]) continue;
            can |= !win[nxta[x][to]][nxtb[y][to]];
        }
        cout << (can ? "Yes\n" : "No\n");
    }
}

int32_t main() {
#ifdef __APPLE__
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0); cin.tie(0);
    int tt = 1;
//    cin >> tt;
    while (tt--) {
        solve();
    }
}