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

using namespace std;
using namespace __gnu_pbds;

//#define int long long
using ll = long long;

typedef tree<int, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int inf = 1e9 + 7;
const ll inf_ = 1e18 + 7;
const int mod = 998244353;

struct Hash {
    int mod2 = 1e9 + 7, p2 = 239;

    int sum(int a, int b) {
        a += b;
        if (a >= mod2) a -= mod2;
        return a;
    }

    int sub(int a, int b) {
        a -= b;
        if (a < 0) a += mod2;
        return a;
    }

    int mul(int a, int b) {
        return a * 1ll * b % mod2;
    }

    vector<int> h, pr;

    Hash(string s) {
        int n = s.size();
        h.resize(n);
        pr.resize(n + 1);
        h[0] = s[0];
        pr[0] = 1;
        for (int i = 1; i < n; i++)
            h[i] = sum(s[i], mul(h[i - 1], p2));
        for (int i = 1; i <= n; i++)
            pr[i] = mul(pr[i], p2);
    }

    int get(int l, int r) {
        return 0;
    }
};

struct Fast {
    void solve() {
        int N, n, M, m, k, q;
        cin >> N >> n >> M >> m >> k >> q;
        vector<pair<int, int>> a1(n), b1(m);
        for (auto &[x, y]: a1) cin >> x >> y, y--;
        for (auto &[x, y]: b1) cin >> x >> y, y--;
        vector<int> a, b;
        for (auto [x, y]: a1)
            while (x--)
                a.push_back(y);
        for (auto [x, y]: b1)
            while (x--)
                b.push_back(y);
        n = N, m = M;
        vector<vector<int>> dp(n, vector<int>(m, 0));
        vector<int> to_a(k, n), to_b(k, m);
        vector<int> sz_a(k), sz_b(k);
        for (int i = n - 1; i >= 0; i--) {
            to_b.assign(k, m);
            to_a[a[i]] = i;
            for (int j = m - 1; j >= 0; j--) {
                to_b[b[j]] = j;
                /* if (b[j] != a[i]) {
                     if (i + 1 < n && dp[i + 1][j] ||
                         j + 1 < m && dp[i][j + 1])
                         dp[i][j] = 1;
                     continue;
                 }*/
                if (to_a[a[n - 1]] + 1 == n || to_b[a[n - 1]] + 1 == m) {
                    dp[i][j] = 1;
                    continue;
                }
                for (int to = 0; to < k; to++) {
                    if (to_a[to] == n || to_b[to] == m)
                        continue;/*
                    if (to_a[to] + 1 == n || to_b[to] + 1 == m) {
                        dp[i][j] = 1;
                        break;
                    }*/
                    if (dp[to_a[to] + 1][to_b[to] + 1] == 0) {
                        dp[i][j] = 1;
                        break;
                    }
                }
            }
        }
        while (q--) {
            int x, y;
            cin >> x >> y;
            if (dp[x][y]) cout << "Yes\n";
            else cout << "No\n";
        }
    }
};

signed main() {
    int __ = 1;
    //cin >> __;
    while (__--) {
        Fast().solve();
        cout << '\n';
    }
    return 0;
}
