#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define all(a) a.begin(), a.end()
void solve() {
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    for (int i = 0; i < n; ++i) {
        int l, v;
        cin >> l >> v;
    }
    for (int i = 0; i < m; ++i) {
        int l, v;
        cin >> l >> v;
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        cout << "Yes\n";
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}
