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

//#pragma GCC optimize("O3")
#define ll long long
#define vec vector
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x.size())
#define pii pair < int, int >
#define f first
#define s second

using namespace std;

template <typename T>
bool umn (T &a, T b) {return a > b ? (a = b, 1) : 0; }
template <typename T>
bool umx (T &a, T b) {return a < b ? (a = b, 1) : 0; }

const int N = 5001;
const int oo = 2e9;
const ll OO = 1e18;
const int mod = 1e9 + 7;

int cnta[N][N];
int cntb[N][N];
int a[N], b[N], fa[N], fb[N], suma[N], sumb[N];
int al[N], av[N], bl[N], bv[N];

void slv () {
    int n, m, nn, mm, k, q, pa = 0, pb = 0;
    cin >> n >> nn >> m >> mm >> k >> q;

    for (int i = 0, l, v; i < nn; ++i) {
        cin >> l >> v;
        --v;
        al[i] = l;
        av[i] = v;

        suma[i] = (i ? suma[i - 1] : 0) + l;
    }
    for (int i = 0, l, v; i < mm; ++i) {
        cin >> l >> v;
        --v;
        bl[i] = l;
        bv[i] = v;

        sumb[i] = (i ? sumb[i - 1] : 0) + l;
    }

    for (int i = mm - 1; i >= 0; --i) {
        if (i != mm - 1) {
            for (int c = 0; c < k; ++c) {
                cntb[i][c] = cntb[i + 1][c];
            }
        }
        cntb[i][bv[i]] += bl[i];
    }

    for (int i = nn - 1; i >= 0; --i) {
        if (i != nn - 1) {
            for (int c = 0; c < k; ++c) {
                cnta[i][c] = cnta[i + 1][c];
            }
        }
        cnta[i][av[i]] += al[i];
    }

    for (int i = 0, f, s; i < q; ++i) {
        cin >> f >> s;
        int ba = upper_bound(suma, suma + nn, f) - suma;
        int bb = upper_bound(sumb, sumb + mm, s) - sumb;

//        cout << "\n" << ba << " " << bb << "\n";

        int ff = suma[ba] - f, ss = sumb[bb] - s, ok = 0;

        for (int j = 0; j < k; ++j) {
            if (j == av[ba]) continue;
            if (min(cnta[ba][j], cntb[bb][j]) % 2 == 1) {
                ok = 1;
                break;
            }
        }

        if (min(cnta[ba + 1][av[ba]] + ff, ss + cntb[bb + 1][av[ba]]) % 2 == 1)
            ok = 1;
        cout << (ok ? "Yes" : "No") << "\n";

    }

}

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
//    cin >> t;
    while (t--) {
        slv();
    }
}
