#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <cmath>

using namespace std;
using ll = long long;

constexpr int INF = 1e9 + 7;
constexpr ll LINF = 1e18 + 7;

struct SegmentTree {
    struct node {
        ll s = 0;
        ll p = 0;
    };
    vector<node>tree;

    inline int L(int v) { return 2 * v + 1; }
    inline int R(int v) { return 2 * v + 2; }

    void push(int v, int l, int r) {
        int mid = (l + r) / 2;
        tree[L(v)].s += tree[v].p * (mid - l);
        tree[L(v)].p += tree[v].p;
        tree[R(v)].s += tree[v].p * (r - mid);
        tree[R(v)].p += tree[v].p;
    }

    void add(int ql, int qr, ll x, int l, int r, int v) {
        if (l >= qr || r <= ql) return;
        if (ql <= l && r <= qr) {
            tree[v].s += x * (r - l);
            tree[v].p += x;
            return;
        }
        int mid = (l + r) / 2;
        push(v, l, r);
        add(ql, qr, x, l, mid, L(v));
        add(ql, qr, x, mid, r, R(v));
        tree[v].s = tree[L(v)].s + tree[R(v)].s;
    }

    void build(vector<int>& a, int l, int r, int v) {
        if (r - l == 1) {
            tree[v].s = a[l];
            return;
        }
        int mid = (l + r) / 2;
        build(a, l, mid, L(v));
        build(a, mid, r, R(v));
        tree[v].s = tree[L(v)].s + tree[R(v)].s;
    }

    SegmentTree(vector<int>& a) {
        int n = a.size();
        tree.resize(4 * n);
        build(a, 0, n, 0);
    }
};
int main()
{
    cin.tie(0)->sync_with_stdio(0);
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int>a;
    vector<int>b;
    vector<pair<int, int>>a1, b1;
    for (int i = 0; i < n; ++i) {
        int l, x;
        cin >> l >> x;
        --x;
        a1.emplace_back(make_pair(x, l));
        for (int j = 0; j < l; ++j) a.emplace_back(x);
    }
    for (int i = 0; i < m; ++i) {
        int l, x;
        cin >> l >> x;
        --x;
        b1.emplace_back(make_pair(x, l));
        for (int j = 0; j < l; ++j) b.emplace_back(x);
    }
    vector<vector<bool>>suf(N + 1, vector<bool>(M + 1));
    for (int i = 0; i <= N; ++i) suf[i][M] = 1;
    for (int j = 0; j <= M; ++j) suf[N][j] = 1;
    vector<bool>used(k);
    for (int i = N - 1; i >= 0; --i) {
        used[a[i]] = 1;
        for (int j = M - 1; j >= 0; --j) {
            if (!used[b[j]]) {
                suf[i][j] = 1;
            }
            else break;
        }
    }
    vector<vector<int>>dp(N + 1, vector<int>(M + 1));
    vector<pair<int, int>>pos(k, { -1, -1 });
    for (int i = N - 1; i >= 0; --i) {
        pos[a[i]].first = i;
        for (int c = 0; c < k; ++c) pos[c].second = -1;
        unordered_set<int>ok;
        for (int j = M - 1; j >= 0; --j) {
            pos[b[j]].second = j;
            ok.erase(b[j]);
            if (pos[b[j]].first != -1 && dp[pos[b[j]].first + 1][pos[b[j]].second + 1] == 0) ok.insert(b[j]);
            if (suf[i][j]) {
                dp[i][j] = 0;
                continue;
            }
            dp[i][j] = (int)(!ok.empty());
        }
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        if (dp[x][y]) cout << "Yes\n";
        else cout << "No\n";


    }

}
