#include <iostream>
#include <vector>
#include <algorithm>
#include <bitset>
#include <ctime>
#include <random>
#include <map>
#include <set>
#define ll long long
#define nl '\n'
#define emp emplace_back
#define all(x) x.begin(), x.end()
#define pll pair<ll, ll>
#define pii pair<int, int>
#define popcnt __builtin_popcount
#define ffs __builtin__ffs
#define ss second
#define ff first
//#include <ext/pb_ds/assoc_container.hpp>
//#pragma GCC optimize("O3")
//#pragma GCC target("avx")
//#pragma GCC target("avx2")

using namespace std;
//using namespace __gnu_pbds;

//typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll INF = 1e9;

const ll mod = 998244353;

mt19937 rnd(time(nullptr));

template<typename T>
istream &operator >>(istream &in, vector<T> &arr) {
    for (auto &x : arr) {
        in >> x;
    }
    return in;
}

template<typename T>
ostream &operator <<(ostream &out, vector<T> &arr) {
    for (auto &x : arr) {
        out << x << ' ';
    }
    out << '\n';
    return out;
}

void solve() {
    ll n, kn, m, km, k, q;
    cin >> n >> kn >> m >> km >> k >> q;
    vector<ll> a, b;
    for (ll i = 0; i < kn; ++i) {
        ll l, u;
        cin >> l >> u;
        if (l % 2 == 0) {
            l = min(l, 2ll);
        }
        else {
            l = min(l, 3ll);
        }
        for (ll j = 0; j < l; ++j) {
            a.emp(u);
        }
    }
    for (ll i = 0; i < km; ++i) {
        ll l, u;
        cin >> l >> u;
        if (l % 2 == 0) {
            l = min(l, 2ll);
        }
        else {
            l = min(l, 3ll);
        }
        for (ll j = 0; j < l; ++j) {
            b.emp(u);
        }
    }
    reverse(all(a));
    reverse(all(b));
    vector<vector<ll>> dp(n + 1, vector<ll> (m + 1));
    vector<ll> preva(k + 1, -1);
    for (ll i = 1; i <= n; ++i) {
        preva[a[i - 1]] = i;
        vector<ll> prevb(k + 1, -1);
        for (ll j = 1; j <= m; ++j) {
            prevb[b[j - 1]] = j;
            for (ll c = 1; c <= k; ++c) {
                if (preva[c] == -1 || prevb[c] == -1)  continue;
                dp[i][j] |= (dp[preva[c] - 1][prevb[c] - 1] ^ 1);
            }
        }
    }
    while (q--) {
        ll x, y;
        cin >> x >> y;
        if (dp[n - x][m - y]) {
            cout << "Yes";
        }
        else {
            cout << "No";
        }
        cout << nl;
    }
}

int main() {
#ifdef CLOCK
    ll time1 = clock();
#endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    ll tpk = 1;

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

    while (tpk--) {
        solve();
        cout << nl;
    }

#ifdef CLOCK
    cout << clock() - time1 << " ms";
#endif
}