#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

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, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<ll> a;
    for (ll i = 0; i < n; i++) {
        ll l, x;
        cin >> l >> x;
        x--;
        for (ll j = 0; j < l; j++) {
            a.push_back(x);
        }
    }
    vector<ll> b;
    for (ll i = 0; i < m; i++) {
        ll l, x;
        cin >> l >> x;
        x--;
        for (ll j = 0; j < l; j++) {
            b.push_back(x);
        }
    }
    vector<vector<bool>> dp(N, vector<bool>(M));
    vector<ll> last(k, -1);
    vector<ll> gg(k, 1);
    ll sum = k;
    for (ll i = N - 1; i >= 0; i--) {
        for (ll j = M - 1; j >= 0; j--) {
            dp[i][j] = sum < k;
            if (last[b[j]] != -1) {
                sum -= gg[b[j]];
                gg[b[j]] = dp[last[b[j]]][j];
                sum += gg[b[j]];
            }
        }
        last[a[i]] = i;
        gg.assign(k, 1);
        sum = k;
    }
    while (q--) {
        ll x, y;
        cin >> x >> y;
        if (!dp[x][y]) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
}
