#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <map>

using namespace std;

vector<vector<int>> gr;
vector<int> s;

set<pair<int, int>> st;
vector<int> ord;
vector<int> pos;

void upd(int v) {
    pos[v] = ord.size();
    ord.push_back(v);
    st.erase({s[v], v});
    for (auto u : gr[v]) {
        st.insert({s[u], u});
    }
}

vector<vector<int>> nxta;
vector<vector<int>> nxtb;
vector<vector<int>> win;
vector<int> na;
vector<int> nb;

int N, M;

void rec(int a, int b, int col) {
    if (a >= N || b >= M) {
        win[a][b] = 0;
        return;
    }
    win[a][b] = 0;
    bool fl = false;
    for (int i = 0; i < nxta[a].size(); i++) {
        
        int ta = nxta[a][i], tb = nxtb[b][i];
        
        if (ta == -1 || tb == -1) {
            continue;
        }
        if (win[ta + 1][tb + 1] == -1) {
            rec(ta + 1, tb + 1, i);
        }
        if (win[ta + 1][tb + 1] == 0) {
            win[a][b] = 1;
            break;
        }
    }
    /*if (win[a][b] == 0) {
        int ta = nxta[a][col], tb = nxtb[b][col];
        if (ta == -1 || tb == -1 || !fl) {
            return;
        }
        int t1 = na[a];
        int t2 = nb[b];
        int t = min(t1, t2);
        if (win[a + t][b + t] == -1) {
            rec(a + t, b + t, -1);
        }
        if (t % 2 == 0 && win[a + t][b + t] == 1) {
            win[a][b] = 1;
        }
    }*/
}

int main()
{
    cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
    int n, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> va;
    vector<int> vb;
    va.reserve(N);
    vb.reserve(M);
    set<int> st;
    for (int i = 0; i < n; i++) {
        int l, v;
        cin >> l >> v;
        st.insert(v);
        for (int j = 0; j < l; j++) {
            va.push_back(v);
        }
    }
    for (int i = 0; i < m; i++) {
        int l, v;
        cin >> l >> v;
        st.insert(v);
        for (int j = 0; j < l; j++) {
            vb.push_back(v);
        }
    }
    map<int, int> mp;
    int it = 0;
    for (auto i : st) {
        mp[i] = it++;
    }
    for (int i = 0; i < N; i++) {
        va[i] = mp[va[i]];
    }
    for (int i = 0; i < M; i++) {
        vb[i] = mp[vb[i]];
    }
    nxta.resize(N, vector<int>(it, -1));
    nxtb.resize(M, vector<int>(it, -1));
    na.resize(N, -1);
    nb.resize(N, -1);
    vector<int> cur(it, -1);
    for (int i = N - 1; i >= 0; i--) {
        cur[va[i]] = i;
        nxta[i] = cur;
    }
    cur.assign(it, -1);
    for (int i = M - 1; i >= 0; i--) {
        cur[vb[i]] = i;
        nxtb[i] = cur;
    }
    na[N - 1] = 1;
    for (int i = N - 2; i >= 0; i--) {
        if (va[i] == va[i + 1]) {
            na[i] = na[i + 1] + 1;
        } else {
            na[i] = 1;
        }
    }
    nb[N - 1] = 1;
    for (int i = N - 2; i >= 0; i--) {
        if (vb[i] == vb[i + 1]) {
            nb[i] = nb[i + 1] + 1;
        } else {
            nb[i] = 1;
        }
    }
    win.resize(N + 1, vector<int>(M + 1, -1));
    for (int i = 0; i < q; i++) {
        int x, y;
        cin >> x >> y;
        if (win[x][y] == -1) {
            rec(x, y, -1);
        }
        if (win[x][y] == 1) {
            cout << "Yes" << '\n';
        } else {
            cout << "No" << '\n';
        }
    }

    return 0;
}