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

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;

#define all(a) a.begin(), a.end()

using ordered_set = tree<int, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;

void solve();

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifdef _GLIBCXX_DEBUG
    freopen("input", "r", stdin);
#endif
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
}

void solve() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<pair<int, int>> a, b;
    vector<int> a1(N), b1(M);
    map<int, pair<int, int>> x;
    int p = 0, p1 = 0, p2 = 0;
    for (int i = 0; i < n; i++) {
        int l, v;
        cin >> l >> v;
        for (int i = p1; i < p1 + l; i++)
            a1[i] = v;
        p1 += l;
        a.push_back({p, v});
        x[v].first = p + 1;
        p += l;
    }
    p = 0;
    for (int i = 0; i < m; i++) {
        int l, v;
        cin >> l >> v;
        for (int i = p2; i < p2 + l; i++)
            b1[i] = v;
        p2 += l;
        b.push_back({p, v});
        x[v].second = p + 1;
        p += l;
    }
    b.push_back({M, 0});
    a.push_back({N, 0});
    vector<pair<int, int>> go;
    for (auto [_, p]: x) {
        if (p.first != 0 && p.second != 0)
            go.push_back(p);
    }
    sort(all(go));
    reverse(all(go));
    int lst = -1, is = -1;
    vector<int> mn;
    for (auto &[l, r]: go) {
        l--;
        r--;
        int len1 = lower_bound(all(a), make_pair(l + 1, 0))->first - l;
        int len2 = lower_bound(all(b), make_pair(r + 1, 0))->first - r;
        if (min(len1, len2) % 2 == 0 && is < r)
            is = max(is, r);
        mn.push_back(is);
    }
    reverse(all(go));
    while (q--) {
        int x, y;
        cin >> x >> y;
        if (a1[x] != b1[y]) {
            cout << "No\n";
            continue;
        }
        int len1 = lower_bound(all(a), make_pair(x + 1, 0))->first - x;
        int len2 = lower_bound(all(b), make_pair(y + 1, 0))->first - y;
        int ind = lower_bound(all(go), make_pair(x + 1, 0)) - go.begin();
        int w = 0;
        if (ind < go.size()) {
            ind = go.size() - ind - 1;
            if (mn[ind] >= y)
                w = 1;
        }
        if (min(len1, len2) % 2 == 1 || w)
            cout << "Yes\n";
        else
            cout << "No\n";
    }
}