#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<vector<bool>> good(n, vector<bool> (m, false));
    vector<vector<bool>> dp(n, vector<bool> (m, false));
    for (ll i = n - 1; i >= 0; --i) {
        vector<bool> isgood(k, false);
        ll cntgood = 0;
        for (ll j = m - 1; j >= 0; --j) {
            if (a[i].second != b[j].second) {
                if (nearest1[i][b[j].second] != -1) {
                    cntgood -= isgood[b[j].second];
                    if (dp[nearest1[i][b[j].second]][j]) isgood[b[j].second] = true;
                    else isgood[b[j].second] = false;
                    cntgood += isgood[b[j].second];
                }
                continue;
            }
            cntgood -= isgood[a[i].second];
            if (cntgood) good[i][j] = true;
            ll nowi = i, nowj = j, now = 0, nowwi = a[nowi].first, nowwj = b[nowj].first;
            while (nowi != -1 && nowj != -1 && !good[nowi][nowj]) {
                ll noww = min(nowwi, nowwj);
                now += noww;
                nowwi -= noww;
                nowwj -= noww;
                if (nowwi == 0) {
                    if (nowi < n - 1) nowi = nearest1[nowi + 1][a[nowi].second];
                    else nowi = -1;
                    if (nowi != -1) nowwi = a[nowi].first;
                }
                if (nowwj == 0) {
                    if (nowj < m - 1) nowj = nearest2[nowj + 1][b[nowj].second];
                    else nowj = -1;
                    if (nowj != -1) nowwj = b[nowj].first;
                }
            }
            if ((nowi != -1 && nowj != -1) || now % 2 == 1) dp[i][j] = true;
            isgood[a[i].second] = dp[i][j];
            cntgood += 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 (good[p1][p2]) {
            cout << "Yes\n";
            continue;
        }

        ll prev1 = 0, prev2 = 0;
        if (p1 > 0) prev1 = pref1[p1 - 1];
        if (p2 > 0) prev2 = pref2[p2 - 1];

        ll nowi = p1, nowj = p2, now = 0, nowwi = a[nowi].first - (x - prev1), nowwj = b[nowj].first - (y - prev2);
        while (nowi != -1 && nowj != -1 && !good[nowi][nowj]) {
            ll noww = min(nowwi, nowwj);
            now += noww;
            nowwi -= noww;
            nowwj -= noww;
            if (nowwi == 0) {
                if (nowi < n - 1) nowi = nearest1[nowi + 1][a[nowi].second];
                else nowi = -1;
                if (nowi != -1) nowwi = a[nowi].first;
            }
            if (nowwj == 0) {
                if (nowj < m - 1) nowj = nearest2[nowj + 1][b[nowj].second];
                else nowj = -1;
                if (nowj != -1) nowwj = b[nowj].first;
            }
        }
        if ((nowi != -1 && nowj != -1) || now % 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();
}
