#include <bits/stdc++.h>

using namespace std;

#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

using ll = long long;

//#define int long long

const int MAX = 5000 + 7;

int N, n, M, m, k, q;
bool win[MAX][MAX][2];
int a[MAX];
int b[MAX];
int nxta[MAX][1601];
int nxtb[MAX][1601];

int lia[MAX], via[MAX];
int lib[MAX], vib[MAX];

void solve() {
    cin >> N >> n >> M >> m >> k >> q;
    for (int i = 1; i <= n; i++) {
        cin >> lia[i] >> via[i];
    }
    for (int i = 1; i <= m; i++) {
        cin >> lib[i] >> vib[i];
    }
    for (int i = n; i >= 1; i--) {
        for (int j = 1; j <= k; j++) {
            nxta[i][j] = nxta[i + 1][j];
        }
        nxta[i][via[i]] = i;
    }
    for (int i = m; i >= 1; i--) {
        for (int j = 1; j <= k; j++) {
            nxtb[i][j] = nxtb[i + 1][j];
        }
        nxtb[i][vib[i]] = i;
    }
    for (int i = n; i >= 1; i--) {
        for (int j = m; j >= 1; j--) {
            if (via[i] != vib[j]) continue;
            win[i][j][0] = false;
            win[i][j][1] = false;
            for (int to = 1; to <= k; to++) {
                //1
                if (nxta[i + 1][to] && nxtb[j + 1][to]) {
                    win[i][j][1] |= !win[nxta[i + 1][to]][nxtb[j + 1][to]][0];
                }
                //0
                if (to == via[i]) {
                    if (min(lia[i], lib[j]) % 2 == 0) {
                        win[i][j][0] |= !win[i][j][1];
                    }
                } else {
                    if (nxta[i + 1][to] && nxtb[j + 1][to]) {
                        win[i][j][0] |= !win[nxta[i + 1][to]][nxtb[j + 1][to]][0];
                    }
                }
            }
        }
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        int i = 1;
        int j = 1;
        while (x - lia[i] >= 0) {
            x -= lia[i++];
        }
        while (y - lib[j] >= 0) {
            y -= lib[j++];
        }
        int waslia = lia[i];
        int waslib = lib[j];
        lia[i] -= x;
        lib[j] -= y;
        int was0 = win[i][j][0];
        int was1 = win[i][j][1];
        win[i][j][0] = false;
        win[i][j][1] = false;
        for (int to = 1; to <= k; to++) {
            //1
            if (nxta[i + 1][to] && nxtb[j + 1][to]) {
                win[i][j][1] |= !win[nxta[i + 1][to]][nxtb[j + 1][to]][0];
            }
            //0
            if (to == via[i]) {
                if (min(lia[i], lib[j]) % 2 == 0) {
                    win[i][j][0] |= !win[i][j][1];
                }
            } else {
                if (nxta[i + 1][to] && nxtb[j + 1][to]) {
                    win[i][j][0] |= !win[nxta[i + 1][to]][nxtb[j + 1][to]][0];
                }
            }
        }
        bool can = false;
        for (int to = 1; to <= k; to++) {
            if (!nxta[i][to]) continue;
            if (!nxtb[j][to]) continue;
            can |= !win[nxta[i][to]][nxtb[j][to]][0];
        }
        cout << (can ? "Yes\n" : "No\n");
        win[i][j][0] = was0;
        win[i][j][1] = was1;
        lia[i] = waslia;
        lib[j] = waslib;
    }
}

int32_t main() {
#ifdef __APPLE__
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0); cin.tie(0);
    int tt = 1;
//    cin >> tt;
    while (tt--) {
        solve();
    }
}