#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

auto seed = chrono::high_resolution_clock().now().time_since_epoch().count();
mt19937 rnd(seed);

template<typename T>
using orderet_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename V>
using table = gp_hash_table<T, V>;

using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ld = long double;
using dd = double;

#define int ll

void solve(){
    int N, n, M, m, k, q;
    cin>>N>>n>>M>>m>>k>>q;
    vector<pair<int, int>> a(n), b(m);
    for(int i =0 ; i <n ; ++i) {
        cin>>a[i].first>>a[i].second;
        a[i].second--;
    }
    for(int i = 0; i < n; ++i){
        cin>>b[i].first>>b[i].second;
        b[i].second--;
    }
    vector<vector<int>> near_a(n, vector<int>(k, -1));
    vector<vector<int>> near_b(m, vector<int>(k, -1));
    for(int i = n-2; i >= 0; --i){
        near_a[i] = near_a[i+1];
        near_a[i][a[i+1].second]=i+1;
    }
    for(int i = m-2; i >= 0; --i){
        near_b[i] = near_b[i+1];
        near_b[i][b[i+1].second]=i+1;
    }
    vector<vector<int>> dp(n, vector<int>(m, 0));
    for(int i = n-1; i >= 0; --i){
        for(int j = m-1; j >= 0; --j){
            if(a[i].second != b[j].second) continue;
            for(int d = 0; d < k; ++d){
                if(d == a[i].second) continue;
                int x = near_a[i][d], y = near_b[j][d];
                if(x != -1 && y != -1 && dp[x][y] == 1){
                    dp[i][j] = 1;
                }
            }
            int x = near_a[i][a[i].second], y = near_b[j][a[i].second];
            if(x == -1 || y == -1) dp[i][j] = min(a[i].first, b[j].first) % 2;
            else if(dp[x][y] != min(a[i].first, b[j].first) % 2) dp[i][j] = 1;
            else dp[i][j] = 0;
        }
    }
    while(q--){
        int A, B;
        cin>>A>>B;
        int a_pos = 0, b_pos = 0;
        for(int i = 0; i < n; ++i){
            if(A < a[i].first){
                a_pos = i;
                break;
            }
            A -= a[i].first;
        }
        for(int i = 0; i < m; ++i){
            if(B < b[i].first){
                b_pos = i;
                break;
            }
            B -= b[i].first;
        }
        bool win = false;
        for(int i = 0; i < k; ++i){
            if(i == a[i].second) continue;
            int x = near_a[a_pos][i], y = near_b[b_pos][i];
            if(x == -1 || y == -1 || dp[x][y] == 0) continue;
            win = true;
            break;
        }
        int x = near_a[a_pos][a[a_pos].second], y = near_b[b_pos][a[a_pos].second];
        if(x == -1 || y == -1) win = min(a[a_pos].first - A, b[b_pos].first - B) % 2;
        else if(dp[x][y] != min(a[a_pos].second - A, b[b_pos].first - B) % 2) win = true;
        if(win) cout << "Yes\n";
        else cout << "No\n";
    }
}

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