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

#define int long long
using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
struct fenw {
    vector<int> f;
    explicit fenw(int n) {
        f.resize(n);
    }
    void upd(int i, int x) {
        while (i < f.size()) {
            f[i] += x;
            i |= (i + 1);
        }
    }
    int get(int i) {
        int sum = 0;
        while (i >= 0) {
            sum += f[i];
            i %= (i + 1);
            i--;
        }
        return sum;
    }
};
template <typename T>
bool smin(T& a, T b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool smax(T& a, T b) {
    if (b > a) {
        a = b;
        return true;
    }
    return false;
}

vector<int> prefa, prefb;
vector<vector<int>> cnt, cntw, dop;
int n, m;
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int N, M, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<pair<int, int>> a;
    vector<pair<int, int>> b;
    prefa.resize(n + 1);
    prefb.resize(m + 1);
    for (int i = 0; i < n; i++) {
        int l, x;
        cin >> l >> x;
        prefa[i + 1] = prefa[i] + l;
        a.emplace_back(l, x);
    }
    for (int i = 0; i < m; i++) {
        int l, x;
        cin >> l >> x;
        prefb[i + 1] = prefb[i] + l;
        b.emplace_back(l, x);
    }
    dop = cntw = cnt = vector<vector<int>> (n + 1, vector<int> (m + 1, 0));
    vector<vector<int>> nexta(n, vector<int> (k + 1));
    vector<vector<int>> nextb(m, vector<int> (k + 1));
    vector<int> cur(k + 1, n);
    for (int i = n - 1; i >= 0; i--) {
        cur[a[i].second] = i;
        for (int j = 0; j <= k; j++) nexta[i][j] = cur[j];
    }
    cur.assign(k + 1, m);
    for (int i = m - 1; i >= 0; i--) {
        cur[b[i].second] = i;
        for (int j = 0; j <= k; j++) nextb[i][j] = cur[j];
    }
    for (int i = n - 1; i >= 0; i--) {
        vector<int> u(k + 1);
        int cntu = 0;
        for (int j = m - 1; j >= 0; j--) {
            if (a[i].second != b[j].second) {
                if (nextb[j][a[i].second] != m) {
                    if (dop[i][nextb[j][a[i].second]]) {
                        cntu += 1 - u[a[i].second];
                        u[a[i].second] = 1;
                    } else {
                        cntu -= u[a[i].second];
                        u[a[i].second] = 0;
                    }
                }
                if (nexta[i][b[j].second] != n) {
                    if (dop[nexta[i][b[j].second]][j]) {
                        cntu += 1 - u[b[j].second];
                        u[b[j].second] = 1;
                    } else {
                        cntu -= u[b[j].second];
                        u[b[j].second] = 0;
                    }
                }
            } else {
                int next1 = prefa[i + 1];
                int next2 = prefb[j + 1];
                if (cnt[i + 1][j + 1]) {
                    dop[i][j] = 0;
                    cntu -= u[a[i].second];
                    u[a[i].second] = 0;
                } else {
                    if (min(next2 - prefb[j], next1 - prefa[i]) % 2 == 0) {
                        dop[i][j] = 0;
                        cntu -= u[a[i].second];
                        u[a[i].second] = 0;
                    } else {
                        dop[i][j] = 1;
                        cntu += 1 - u[a[i].second];
                        u[a[i].second] = 1;
                    }
                }
            }
            cnt[i][j] = cntu > 0;
        }
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        int i1 = upper_bound(prefa.begin(), prefa.end(), x) - prefa.begin();
        int i2 = upper_bound(prefb.begin(), prefb.end(), y) - prefb.begin();
        if (cnt[i1][i2]) {
            cout << "Yes\n";
        } else {
            if (min(prefb[i2] - y, prefa[i1] - x) % 2 == 1) {
                cout << "Yes\n";
            } else {
                cout << "No\n";
            }
        }
    }
    return 0;
}