#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;
int win[MAX][MAX];
int a[MAX];
int b[MAX];
int nxta[MAX][1601];
int nxtb[MAX][1601];

bool cans(int i, int j) {
    if (win[i][j] != -1) return win[i][j];
    win[i][j] = 0;
    for (int to = 1; to <= k; to++) {
        if (!nxta[i + 1][to]) continue;
        if (!nxtb[j + 1][to]) continue;
        win[i][j] |= !cans(nxta[i + 1][to], nxtb[j + 1][to]);
    }
    return win[i][j];
}

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;
        }
    }
    int now = 0;
    for (int i = 1; i <= n; i++) {
        int li, vi;
        cin >> li >> vi;
        li %= 20;
        for (int j = now + 1; j <= now + li; j++) {
            a[j] = vi;
        }
        now += li;
    }
    now = 0;
    for (int i = 1; i <= m; i++) {
        int li, vi;
        cin >> li >> vi;
        li %= 20;
        for (int j = now + 1; j <= now + li; j++) {
            b[j] = vi;
        }
        now += li;
    }
    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;
    }
    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 |= !cans(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();
    }
}