
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC optimize("O3")
#define ll long long
#define vec vector
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x.size())
#define pii pair < int, int >
#define f first
#define s second

using namespace std;

template <typename T>
bool umn (T &a, T b) {return a > b ? (a = b, 1) : 0; }
template <typename T>
bool umx (T &a, T b) {return a < b ? (a = b, 1) : 0; }

const int N = 5001;
const int oo = 2e9;
const ll OO = 1e18;
const int mod = 1e9 + 7;

int add (int x, int y) {
    x += y;
    if (x >= mod)
        x -= mod;
    return x >= 0 ? x : x + mod;
}

int mul (int x, int y) {
    return (1ll * x * y) % mod;
}

int bpow (int a, int b) {
    if (b == 0)
        return 1;
    if (b % 2)
        return mul(bpow(a, b - 1), a);
    int t = bpow(a, b / 2);
    return mul(t, t);
}



bool win[N][N];
int a[N], b[N], fa[N], fb[N];

void slv () {
    int n, m, nn, mm, k, q, pa = 0, pb = 0;
    cin >> n >> nn >> m >> mm >> k >> q;

    for (int i = 0, l, v; i < nn; ++i) {
        cin >> l >> v;
        for (int j = 0; j < l; ++j)
            a[pa++] = v;
    }
    for (int i = 0, l, v; i < mm; ++i) {
        cin >> l >> v;
        for (int j = 0; j < l; ++j)
            b[pb++] = v;
    }

    for (int i = 0; i < N; ++i) {
        win[i][m] = win[n][i] = 0;
        fa[i] = -1;
    }

    for (int i = n - 1; i >= 0; --i) {
        for (int j = 0; j <= k; ++j)
            fb[j] = m;
        fa[a[i]] = i;
        int cnt = 0;
        for (int j = m - 1; j >= 0; --j) {
            if (fa[b[j]] != -1 && fb[b[j]] != m) {
                if (!win[fa[b[j]] + 1][fb[b[j]] + 1])
                    cnt--;
            }
            fb[b[j]] = j;
            if (fa[b[j]] != -1) {
                if (!win[fa[b[j]] + 1][fb[b[j]] + 1])
                    cnt++;
            }


            win[i][j] = cnt > 0;
        }
    }

    for (int i = 0, f, s; i < q; ++i) {
        cin >> f >> s;
//        --f, --s;
        cout << (win[f][s] ? "Yes" : "No") << "\n";
    }

}

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
//    cin >> t;
    while (t--) {
        slv();
    }
}
