#include <bits/stdc++.h>
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define all(v) v.begin(), v.end()
#define ln << '\n'
#define int long long
using namespace std;

const int G = 2e6 + 22;
const int C = 2700;
const int oo = 1e18 + 22;
int N, n, M, m, k, q, psa[C], psb[C], lena[C], lenb[C], cola[C], colb[C], sfa[C], sfb[C];
bool alicewin[C][C];
vi a_with_color[C];
vi b_with_color[C];
vii all_a, all_b;

int get_nearest(vi blocks, int *position, int ps) {
    int l = 0, r = blocks.size() - 1;
    while (l + 3 < r) {
        int md = (l + r + 1) / 2;
        if (position[blocks[md]] >= ps) r = md;
        else l = md + 1;
    }

    for (int i = l; i <= r; i++)
        if (position[blocks[i]] >= ps) return blocks[i];
    return -1;
}

int32_t main() {
    cin.tie(0); cout.tie(0); ios::sync_with_stdio(0);
    cin >> N >> n >> M >> m >> k >> q;
    int T = 1;
    for (int i = 1; i <= n; i++) {
        int cnt, vl; cin >> cnt >> vl;

        psa[i] = T; lena[i] = cnt; cola[i] = vl;
        a_with_color[vl].push_back(i);
        all_a.push_back({T, i});

        T += cnt;
    }
    T = 1;
    for (int i = 1; i <= m; i++) {
        int cnt, vl; cin >> cnt >> vl;

        psb[i] = T; lenb[i] = cnt; colb[i] = vl;
        b_with_color[vl].push_back(i);
        all_b.push_back({T, i});

        T += cnt;
    }

    ii last_color = {-1, -1};
    for (int c = 1; c <= k; c++) {
        int pa = a_with_color[c].size() - 1;
        int pb = b_with_color[c].size() - 1;

        if (pa >= 0 && pb >= 0) last_color = max(last_color, {psa[a_with_color[c][pa]], c});

        int cur = 0;
        while (pa >= 0) {
            int block = a_with_color[c][pa];
            cur += lena[block];
            sfa[block] = cur;
            pa--;
        }

        cur = 0;
        while (pb >= 0) {
            int block = b_with_color[c][pb];
            cur += lenb[block];
            sfb[block] = cur;
            pb--;
        }
    }

    for (int blocka = 1; blocka <= n; blocka++) {
        for (int blockb = 1; blockb <= n; blockb++) {
            if (cola[blocka] != colb[blockb]) continue;

            int c = last_color.second;

            if (c == cola[blocka]) continue;

            int blockac = get_nearest(a_with_color[c], psa, psa[blocka]);
            int blockbc = get_nearest(b_with_color[c], psb, psb[blockb]);
            if (blockac != -1 && blockbc != -1) {
                alicewin[blocka][blockb] |= (min(sfa[blockac], sfb[blockbc]) % 2 == 1);
            }
        }
    }

    while (q--) {
        int x, y; cin >> x >> y;
        x++; y++;

        int blocka = lower_bound(all(all_a), make_pair(x, oo)) - all_a.begin();
        int blockb = lower_bound(all(all_b), make_pair(y, oo)) - all_b.begin();

        // if (alicewin[blocka][blockb]) cout << "Yes" ln;
        // else if ((min(sfa[blocka] - (x - psa[blocka]), sfb[blockb] - (y - psb[blockb])) % 2 == 1)) cout << "Yes" ln;
        // else cout << "No" ln;

        if (last_color.second == cola[blocka] && (min(sfa[blocka] - (x - psa[blocka]), sfb[blockb] - (y - psb[blockb])) % 2 == 1)) cout << "Yes" ln;
        else if (last_color.second != cola[blocka] && alicewin[blocka][blockb]) cout << "Yes" ln;
        else cout << "No" ln;
    }
    return 0;
}