#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
// #pragma GCC optimize("03")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("avx,avx2,bmi2,fma")

signed main() {
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> a, b;

    for (int i = 0; i < n; ++i) {
        int l, v;
        cin >> l >> v;
        while (l--) {
            a.emplace_back(l);
        }
    }
    for (int i = 0; i < m; ++i) {
        int l, v;
        cin >> l >> v;
        while (l--) {
            b.emplace_back(l);
        }
    }

    while (q--) {
        int x, y;
        cin >> x >> y;
        if (max(x, y) % 2 == 1) {
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
        }
    }
}

/*

5 1 5 1 1 9
5 1
5 1
0 0
0 1
0 2
1 0
1 1
1 2
2 0
2 1
2 2


Yes
No
Yes
No
No
Yes
Yes
Yes
Yes

*/