#include <bits/stdc++.h>

using namespace std;
#define int long long

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> la(n), lb(m), va(n), vb(m), pa(n), pb(m);
    for (int i = 0; i < n; i++)
        cin >> la[i] >> va[i];
    for (int i = 0; i < m; i++)
        cin >> lb[i] >> vb[i];
    for (int i = 0; i < n; i++)
        pa[i] = (i > 0 ? pa[i - 1] : 0) + la[i];
    for (int i = 0; i < m; i++)
        pb[i] = (i > 0 ? pb[i - 1] : 0) + lb[i];
    bool dp[n][m];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            dp[i][j] = false;
        }
    }
    for (int i = n - 1; i >= 0; i--) {
        deque<int> block[k + 1];
        for (int j = m - 1; j >= 0; j--) {
            block[vb[j]].push_front(j);
            if (i + 1 < n && dp[i + 1][j])
                dp[i][j] = true;
            if (va[i] != vb[j]) {
                if (j + 1 < m && dp[i][j + 1])
                    dp[i][j] = true;
                continue;
            }
            int move = 0, c1 = la[i];
            for (int ind: block[va[i]]) {
                if (c1 == 0) break;
                if (i + 1 < n && ind + 1 < m && dp[i + 1][ind + 1]) {
                    if (move == 0)
                        dp[i][j] = true;
                    move = -1;
                    break;
                }
                if (min(c1, lb[ind]) % 2 == 1)
                    move = 1 - move;
                c1 -= min(c1, lb[ind]);
            }
            if (move == 1) dp[i][j] = true;
        }
    }
    for (int i = 0; i < q; i++) {
        int x, y;
        cin >> x >> y;
        int l = -1, r = n - 1, i1, i2;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (pa[mid] <= x) l = mid;
            else r = mid;
        }
        i1 = r, l = -1, r = m - 1;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (pb[mid] <= y) l = mid;
            else r = mid;
        }
        i2 = r;
        bool good = false;
        int c1 = pa[i1] - x, c2 = pb[i2] - y;
        if (i1 + 1 < n && i2 + 1 < m && dp[i1 + 1][i2 + 1])
            good = true;
        if (va[i1] != vb[i2] && !good) {
            for (int j = i1 + 1; j < n; j++) {
                if (va[j] == vb[i2]) {
                    bool gd = (j + 1 < n && i2 + 1 < m && dp[j + 1][i2 + 1]);
                    if (c2 >= la[j]) {
                        if (!gd && min(c2, la[j]) % 2 == 1)
                            good = true;
                    } else if (!gd) {
                        int move = 0;
                        if (min(c2, la[j]) % 2 == 1)
                            move = 1;
                        int cc1 = la[j] - c2;
                        for (int t = i2 + 1; t < m; t++) {
                            if (cc1 == 0) break;
                            if (vb[t] != va[j]) continue;
                            if (j + 1 < n && t + 1 < m && dp[j + 1][t + 1]) {
                                if (move == 0)
                                    good = true;
                                move = -1;
                                break;
                            }
                            if (min(cc1, lb[t]) % 2 == 1)
                                move = 1 - move;
                            cc1 -= min(cc1, lb[t]);
                        }
                        if (move == 1) good = true;
                    }
                    break;
                }
            }
        }
        if (!good) {
            int move = 0;
            if (vb[i2] == va[i1]) {
                if (min(c1, c2) % 2 == 1) move = 1;
                c1 -= min(c1, c2);
            }
            for (int t = i2 + 1; t < m; t++) {
                if (c1 == 0) break;
                if (vb[t] == va[i1]) {
                    bool gd = (i1 + 1 < n && t + 1 < m && dp[i1 + 1][t + 1]);
                    if (gd) {
                        if (move == 0)
                            good = true;
                        move = -1;
                        break;
                    }
                    if (min(c1, lb[t]) % 2 == 1) move = 1 - move;
                    c1 -= min(c1, lb[t]);
                }
            }
            if (move == 1) good = true;
        }
        cout << (good ? "Yes\n" : "No\n");
    }
    return 0;
}