#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const ll INF = 1e15;


void solve() {
    ll N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<pair<ll, ll>> a(n), b(m);
    for (ll i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
    for (ll i = 0; i < m; ++i) cin >> b[i].first >> b[i].second;
    for (auto & i : a) --i.second;
    for (auto & i : b) --i.second;

    vector<vector<ll>> cnt1(n, vector<ll>(k, 0));
    vector<vector<ll>> cnt2(m, vector<ll>(k, 0));

    for (ll i = n - 1; i >= 0; --i) {
        if (i < n - 1) cnt1[i] = cnt1[i + 1];
        cnt1[i][a[i].second] += a[i].first;
    }
    for (ll i = m - 1; i >= 0; --i) {
        if (i < m - 1) cnt2[i] = cnt2[i + 1];
        cnt2[i][b[i].second] += b[i].first;
    }

    vector<vector<ll>> nearest1(n, vector<ll>(k, -1));
    vector<vector<ll>> nearest2(m, vector<ll>(k, -1));

    for (ll i = n - 1; i >= 0; --i) {
        if (i != n - 1) nearest1[i] = nearest1[i + 1];
        nearest1[i][a[i].second] = i;
    }
    for (ll i = m - 1; i >= 0; --i) {
        if (i != m - 1) nearest2[i] = nearest2[i + 1];
        nearest2[i][b[i].second] = i;
    }

    vector<bool> isgood(k, false);
    vector<vector<ll>> dp(n, vector<ll>(m, 0));
    for (ll i = n - 1; i >= 0; --i) {
        ll good = 0;
        for (ll j = m - 1; j >= 0; --j) {
            if (a[i].second != b[j].second) {
                if (nearest1[i][b[j].second] != -1) {
                    good -= isgood[b[j].second];
                    if (dp[nearest1[i][b[j].second]][j]) isgood[b[j].second] = true;
                    else isgood[b[j].second] = false;
                    good += isgood[b[j].second];
                }
                continue;
            }
            if (good > 0)
                dp[i][j] = 1;
            else if (min(cnt1[i][a[i].second], cnt2[j][a[i].second]) % 2 == 1) {
                dp[i][j] = 2;
            }
            good -= isgood[a[i].second];
            if (dp[i][j]) {
                isgood[a[i].second] = true;
            } else {
                isgood[a[i].second] = false;
            }
            good += isgood[a[i].second];
        }
    }
    vector<ll> pref1(n, a[0].first), pref2(m, b[0].first);
    for (ll i = 1; i < n; ++i) pref1[i] = pref1[i - 1] + a[i].first;
    for (ll i = 1; i < m; ++i) pref2[i] = pref2[i - 1] + b[i].first;
    while (q--) {
        ll x, y;
        cin >> x >> y;
        ll p1 = upper_bound(pref1.begin(), pref1.end(), x) - pref1.begin();
        ll p2 = upper_bound(pref2.begin(), pref2.end(), y) - pref2.begin();
        if (dp[p1][p2] == 1) cout << "Yes\n";
        else {
            ll prev1 = 0, prev2 = 0;
            if (p1 > 0) prev1 = pref1[p1 - 1];
            if (p2 > 0) prev2 = pref2[p2 - 1];
            ll now1 = x - prev1, now2 = y - prev2;
            ll mini = min(cnt1[p1][a[p1].second] - now1, cnt2[p2][a[p1].second] - now2);
            if (mini % 2 == 1) cout << "Yes\n";
            else cout << "No\n";
        }
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll t = 1;
    // cin >> t;
    while (t--) solve();
}
