#include <bits/stdc++.h>
#include <immintrin.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

using namespace std;

const int N = 1100;

random_device rd;

mt19937 rnd(rd());

void solve(){
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<pair<int, int>> a(n), b(m);
    vector<int> la(n), lb(m), inda(n, -1), indb(n, -1);
    int now = 0;
    for(int i = 0; i < n; i++){
        int l, v;
        cin >> l >> v;
        v--;
        if(inda[v] == -1){
            inda[v] = i;
        }
        a[i] = {now, v};
        now += l;
        la[i] = l;
    }
    now = 0;
    for(int i = 0; i < m; i++){
        int l, v;
        cin >> l >> v;
        v--;
        if(indb[v] == -1){
            indb[v] = i;
        }
        b[i] = {now, v};
        now += l;
        lb[i] = l;
    }
    vector<vector<int>> dp(n + 1, vector<int>(m + 1));
    for(int i = n - 1; i >= 0; i--){
        for(int j = m - 1; j >= 0; j--){
            if(a[i].second != b[i].second){
                dp[i][j] = (dp[i][j + 1] || dp[i + 1][j]);
            }else{
                int t = min(la[i], lb[j]);
                if(t % 2 == 1){
                    dp[i][j] = 1;
                }else{
                    dp[i][j] = (dp[i][j + 1] || dp[i + 1][j]);
                }
            }
        }
    }
    while(q--){
        int x, y;
        cin >> x >> y;
        pair<int, int> x1 = {x, k};
        pair<int, int> y1 = {y, k};
        int i = (upper_bound(a.begin(), a.end(), x1) - a.begin()) - 1;
        int j = (upper_bound(b.begin(), b.end(), y1) - b.begin()) - 1;
        //cout << i << " " << j << endl;
        int t = min(a[i].first + la[i] - x, b[i].first + lb[i] - y);
        //cout << t << endl;
        if(t % 2 == 1){
            cout << "Yes\n";
        }else{
            if(dp[i + 1][j + 1]){
                cout << "Yes\n";
            }else{
                cout << "No\n";
            }
        }
    }
}

signed main(){
#ifdef lisie_bimbi
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    cin.tie(nullptr)->sync_with_stdio(false);
#endif            
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}