
#include <bits/stdc++.h>

using namespace std;

//#define int int64_t
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ld long double

const int maxn = 2e5;
const int LOG = 30;
const int N = 2e3;
const ld eps = 1e-12;

inline void solve() {
    int n, n1, m, m1, k, q;
    cin >> n >> n1 >> m >> m1 >> k >> q;
    vector<int> a, b;
    int s1, s2;
    for (int i = 0; i < n1; i++) {
        int l, v;
        cin >> l >> v;
        if(i == 0) {
            s1 = max((int)0, l - 800);
            l = min((int)800, l);
        }
        while (l--) a.pb(v - 1);
    }
    for (int i = 0; i < m1; i++) {
        int l, v;
        cin >> l >> v;
        if(i == 0) {
            s2 = max((int)0, l - 800);
            l = min((int)800, l);
        }
        while (l--) b.pb(v - 1);
    }
    n = a.size();
    m = b.size();

    vector<vector<int>> Ia(n, vector<int> (k, n));
    vector<vector<int>> Ib(m, vector<int> (k, m));

    for(int i = n - 1; i > -1; i--) {
        if(i + 1 != n) {
            Ia[i] = Ia[i + 1];
        }
        Ia[i][a[i]] = i;
    }
    for(int i = m - 1; i > -1; i--) {
        if(i + 1 != m) {
            Ib[i] = Ib[i + 1];
        }
        Ib[i][b[i]] = i;
    }


    vector<vector<int>> dp(n, vector<int>(m, 0));
    for (int i = n - 1; i > -1; i--) {
        for (int j = m - 1; j > -1; j--) {
            if(a[i] == b[j]) {
                dp[i][j] = 1;
                for(int V = 0; V < k; V++) {
                    if(i + 1 < n && j + 1 < m && Ia[i + 1][V] != n && Ib[j + 1][V] != m) {
                        dp[i][j] &= (1 - dp[Ia[i + 1][V]][Ib[j + 1][V]]);
                    }
                }
            }
        }
    }

    while (q--) {
        int l, r;
        cin >> l >> r;
        l -= s1;
        r -= s2;
        int f = 0;
        for(int V = 0; V < k; V++) {
            if(Ia[l][V] != n && Ib[r][V] != m && dp[Ia[l][V]][Ib[r][V]] == 1) {
                f = 1;
                break;
            }
        }
        if (f) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
    return;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int tt = 1;
    //cin >> tt;

#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    while (tt--) {
        solve();
    }
    return 0;
}
