#include <bits/stdc++.h>
#define pb push_back
#define endl "\n"
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;


void solve(){
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<pii> a, b;
    for (int i = 0; i < n; ++i) {
        int l, v;
        cin >> l >> v;
        v--;
        a.pb({l, v});
    }
    for (int i = 0; i < m; ++i){
        int l, v;
        cin >> l >> v;
        v--;
        b.pb({l, v});
    }
    vector<int> sma(n + 1, 0), smb(m + 1, 0);
    for (int i = 0; i < n; ++i){
        sma[i + 1] = sma[i] + a[i].first;
    }
    for (int i = 0; i < m; ++i){
        smb[i + 1] = smb[i] + b[i].first;
    }
    vector<pii> ind(k, {-1, -1});
    for (int i = 0; i < n; ++i){
        ind[a[i].second].first = i;
    }
    for (int i = 0; i < m; ++i){
        ind[b[i].second].second = i;
    }
    vector<int> good(k, 0);
    vector<int> good1(k, 0); // умею ли я перескакивать в проигрышную позицию
    for (int now = n - 1; now > -1; --now){
        int el = a[now].second;
        int i = now;
        int j = ind[el].second;
        if (j == -1) continue;
        int len = min(a[i].first, b[j].first);
        int ok = 0;
        int st = 0;
        for (int el1 = 0; el1 < k; ++el1){
            if (ind[el1].first > i && ind[el1].second > j){
                st = 1;
                if (good[el1] == 0) ok = 1;
            }
        }
        if (len % 2) good[el] = 1;
        else good[el] = ok;
        good1[el] = ok;
    }

    while (q--){
        int x, y;
        cin >> x >> y;
        int l, r;
        l = -1; r = n;
        while (r - l > 1){
            int md = (l + r) / 2;
            if (sma[md + 1] <= x) l = md;
            else r = md;
        }
        int i = r;
        l = -1; r = m;
        while (r - l > 1){
            int md = (l + r) / 2;
            if (smb[md + 1] <= y) l = md;
            else r = md;
        }
        int j = r;
        // i, j
        int len = min(sma[i + 1] - x, smb[j + 1] - y);
        if (len % 2 || good1[a[i].second] == 1){
            cout << "Yes" << endl;
        } else{
            cout << "No" << endl;
        }
    }
}



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