#include <bits/stdc++.h>

using namespace std;

const int T = 1610;
const int Q = 1100000;
const int INF = (int)(1e9);

struct segtree {
    vector<int> vv; int n;
    segtree() {}
    segtree(int n) {
        this->n = n;
        vv = vector<int>(4 * n + 1, INF);
    }
    void upd(int l, int r, int x) {
        upd(1, 1, n, l, r, x);
    }
    int get(int k) {
        return get(1, 1, n, k);
    }
    void upd(int v, int l, int r, int ql, int qr, int x) {
        if (qr < l || r < ql)
            return;
        if (ql <= l && r <= qr) {
            vv[v] = min(vv[v], x);
            return;
        }
        int mid = (l + r) / 2;
        upd(v * 2 + 0, l, mid, ql, qr, x);
        upd(v * 2 + 1, mid + 1, r, ql, qr, x);
    }
    int get(int v, int l, int r, int k) {
        if (l == r)
            return vv[v];
        int mid = (l + r) / 2;
        int ans = vv[v];
        if (k <= mid)
            ans = min(ans, get(v * 2 + 0, l, mid, k));
        else
            ans = min(ans, get(v * 2 + 1, mid + 1, r, k));
        return ans;
    }
};

bool ans[T][T], to[T], res[Q];
int to_cnt, to_nxt[T], sz1[T], sz2[T];
int N, n, M, m, k, q, qx[Q], qy[Q], l1[T], r1[T], t1[T], l2[T], r2[T], t2[T], ld[T], rd[T], ll1[T], rr1[T], ll2[T], rr2[T];
vector<int> s1[T], s2[T], pp[T], qq[T][T];
segtree ss[T];

int32_t main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> N >> n >> M >> m >> k >> q;
    for (int i = 1; i <= k; i++)
        sz1[i] = 0;
    int SZ = 0;
    for (int i = 1; i <= n; i++) {
        int L, V; cin >> L >> V;
        l1[i] = sz1[V] + 1;
        r1[i] = sz1[V] + L;
        sz1[V] += L;
        ll1[i] = SZ + 1;
        rr1[i] = SZ + L;
        SZ += L;
        t1[i] = V;
        s1[V].push_back(i);
    }
    for (int i = 1; i <= k; i++)
        sz2[i] = 0;
    SZ = 0;
    for (int i = 1; i <= m; i++) {
        int L, V;
        cin >> L >> V;
        l2[i] = sz2[V] + 1;
        r2[i] = sz2[V] + L;
        sz2[V] += L;
        ll2[i] = SZ + 1;
        rr2[i] = SZ + L;
        SZ += L;
        t2[i] = V;
        s2[V].push_back(i);
    }
    for (int i = 1; i <= q; i++) {
        cin >> qx[i] >> qy[i];
        qx[i]++;
        qy[i]++;
        int p1 = upper_bound(ll1 + 1, ll1 + n + 1, qx[i]) - ll1 - 1;
        int p2 = upper_bound(ll2 + 1, ll2 + n + 1, qy[i]) - ll2 - 1;
        qq[p1][p2].push_back(i);
    }
    for (int i = 1; i <= k; i++)
        ld[i] = INF, rd[i] = -INF;
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++) {
            if (t1[i] != t2[j])
                continue;
            ld[t1[i]] = min(ld[t1[i]], l1[i] - r2[j]);
            rd[t1[i]] = max(rd[t1[i]], r1[i] - l2[j]);
            pp[t1[i]].push_back(ld[t1[i]]);
            pp[t2[i]].push_back(rd[t1[i]] + 1);
        }
    for (int i = 1; i <= k; i++) {
        ld[i] = min(ld[i], rd[i]);
        sort(begin(pp[i]), end(pp[i]));
        pp[i].erase(unique(begin(pp[i]), end(pp[i])), end(pp[i]));
        ss[i] = segtree((int) pp[i].size());
    }
    for (int i = 1; i <= k; i++)
        to_nxt[i] = -1;
    for (int i = n; i >= 1; i--) {
        int cur = t1[i];
        to_nxt[cur] = i;
        to_cnt = 0;
        for (int j = 1; j <= k; j++)
            to[j] = false;
        for (int j = m; j >= 1; j--) {
            if (t2[j] != cur) {
                int cur_j = t2[j];
                bool win = false;
                if (to_nxt[cur_j] != -1 && !ans[to_nxt[cur_j]][j])
                    win = true;
                to_cnt -= to[cur_j];
                to[cur_j] = win;
                to_cnt += to[cur_j];
                continue;
            }
            if (to_cnt == 0) {
                int diff = l1[i] - l2[j];
                diff = upper_bound(begin(pp[cur]), end(pp[cur]), diff) - begin(pp[cur]) - 1;
                int ti = ss[cur].get(diff);
                if (ti == INF)
                    ans[i][j] = min(sz1[cur] - l1[i], sz2[cur] - l2[j]) % 2 != 0;
                else
                    ans[i][j] = (l1[ti] - l1[i]) % 2 == 0;
                for (int k : qq[i][j]) {
                    int px = qx[k] - ll1[i] + l1[i];
                    int py = qy[k] - ll2[j] + l2[j];
                    int diff = px - py;
                    diff = upper_bound(begin(pp[cur]), end(pp[cur]), diff) - begin(pp[cur]) - 1;
                    int ti = ss[cur].get(diff);
                    if (ti == INF)
                        res[k] = !(min(sz1[cur] - px, sz2[cur] - py) % 2 != 0);
                    else
                        res[k] = !((l1[ti] - px) % 2 == 0);
                }
            } else {
                for (int k : qq[i][j])
                    res[k] = true;
                ans[i][j] = true;
                int ldiff = l1[i] - r2[j];
                int rdiff = r1[i] - l2[j] + 1;
                ldiff = lower_bound(begin(pp[cur]), end(pp[cur]), ldiff) - begin(pp[cur]);
                rdiff = lower_bound(begin(pp[cur]), end(pp[cur]), rdiff) - begin(pp[cur]) - 1;
                ss[cur].upd(ldiff, rdiff, i);
            }
        }
    }
    for (int i = 1; i <= q; i++)
        if (res[i]) cout << "Yes\n";
        else cout << "No\n";
}