#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve() {
    int n, nl, m, ml;
    cin >> n >> nl >> m >> ml;
    int k, q; cin >> k >> q;
    vector<int> a(n), b(m);
    for (int q = 0; q < n;) {
        int le, u; cin >> le >> u;
        for (int j = q; j < q + le; j++) {
            a[j] = u;
        }
        q += le;
    }
    for (int q = 0; q < m;) {
        int le, u; cin >> le >> u;
        for (int j = q; j < q + le; j++) {
            b[j] = u;
        }
        q += le;
    }
    vector<vector<int>> wa(k + 1);
    vector<vector<int>> wb(k + 1);
    for (int i = 0; i < n; i++) {
        wa[a[i]].push_back(i);
    }
    for (int i = 0; i < m; i++) {
        wb[b[i]].push_back(i);
    }
    vector<vector<int>> dp(n + 1, vector<int>(m + 1));
    for (int i = 0; i <= n; i++) {
        dp[i][m] = 0;
    }
    for (int i = 0; i <= m; i++) {
        dp[n][i] = 0;
    }
    
    for (int i = n - 1; i >= 0; i--) {
        for (int j = m - 1; j >= 0; j--) {
            for (int elem = k; elem >= 0; elem--) {
                auto it = lower_bound(wa[elem].begin(), wa[elem].end(), i);
                auto it2 = lower_bound(wb[elem].begin(), wb[elem].end(), j);
                if (it != wa[elem].end() && it2 != wb[elem].end()) {
                    int ip = *it;
                    int jp = *it2;
                    if (dp[ip + 1][jp + 1] == 0) {
                        dp[i][j] = 1;
                        break;
                    }
                }
            }
        }
    }
    while (q--) {
        int i, j; cin >> i >> j;
        if (dp[i][j] % 2) cout << "Yes\n";
        else cout << "No\n";
    }
}
signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    solve();
    return 0;
}
