#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

#define all(x) begin(x), end(x)
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
vector<vector<ll>> b1, b2;
int N, n, M, m, k, q;
unordered_map<ll, ll> ndp;

ll rec(vector<deque<ll>> &osta, vector<deque<ll>> &ostb, ll k1, ll k2){
    if (ndp[k1 * 1e5 + k2]) return ndp[k1 * 1e5 + k2] - 1;
    for (int i=0; i<b1.size(); ++i) while (!osta[i].empty() && osta[i][0] <= k1) b1[i].push_back(osta[i][0]), osta[i].pop_front();
    for (int i=0; i<b1.size(); ++i) while (!ostb[i].empty() && ostb[i][0] <= k2) b2[i].push_back(ostb[i][0]), ostb[i].pop_front();
    ll fl = 0;
    for (int i=0; i<osta.size(); ++i) {
        if (fl) break;
        if (!osta[i].empty() && !ostb[i].empty()) fl |= !rec(osta, ostb, osta[i][0], ostb[i][0]);
    }
    for (int i=0; i<b1.size(); ++i) while (!b1[i].empty()) osta[i].push_front(b1[i].back()), b1[i].pop_back();
    for (int i=0; i<b2.size(); ++i) while (!b2[i].empty()) ostb[i].push_front(b2[i].back()), b2[i].pop_back();
    ndp[k1 * 1e5 + k2] = fl + 1;
    return fl;
}

void solve(){
    cin >> N >> n >> M >> m >> k >> q;
    b1.resize(k);
    b2.resize(k);
    deque<ll> a, b;
    for (int i=0; i<n; ++i){
        int l, r;
        cin >> l >> r;
        while (l--) a.push_back(r);
    }
    for (int i=0; i<m; ++i){
        int l, r;
        cin >> l >> r;
        while (l--) b.push_back(r);
    }
    while (q--){
        int x, y;
        cin >> x >> y;
        auto a1 = a, bb = b;
        while (x--) a1.pop_front();
        while (y--) bb.pop_front();
        vector<deque<ll>> osta(k);
        vector<deque<ll>> ostb(k);
        for (int i=0; i<a1.size(); ++i) osta[a1[i]-1].push_back(i);
        for (int i=0; i<bb.size(); ++i) ostb[bb[i]-1].push_back(i);
        ndp.clear();
        cout << (rec(osta, ostb, -1, -1) ? "Yes" : "No") << '\n';
//        cout << '\n';
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ll t;
//    cin >> t;
    t = 1;
    while (t--) solve(), cout << '\n';
    return 0;
}
