#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"

using namespace __gnu_pbds;
using namespace std;

#define fi first
#define se second
#define for0(i, n) for (ll i = 0; i < n; i++)
#define for1(i, n) for (ll i = 1; i < n; i++)
#define con continue
#define ret return
#define pb push_back
#define sz(x) x.size()
#define pob pop_back
#define be(x) x.begin()
#define en(x) x.end()
#define all(x) be(x), en(x)
#define rfor0(i, n) for (ll i = n - 1; i >= 0; i--)
#define rfor1(i, n) for (ll i = n - 1; i >= 1; i--)
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define endl '\n'
#define rev reverse
#define co count
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define rs resize
#define rsun(x) x.rs(unique(all(x)) - be(x))
#define ins insert
#ifdef OG_Matveychick1
bool local = 1;
#else
bool local = 0;
#endif


typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef string str;
typedef vector<pll> vpll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef set<ll> sll;
typedef queue<ll> qll;
typedef vector<vector<ll>> vvll;
typedef set<pll> spll;
typedef vector<str> vs;
typedef long double ld;
typedef vector<vpll> vvpll;
typedef multiset<ll> msll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> orderes_set;
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> orderes_multiset;

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

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &a) {
    in >> a.first >> a.second;
    ret in;
}

template<typename T1, typename T2>
ostream &operator<<(ostream &out, pair<T1, T2> &a) {
    out << a.first << ' ' << a.second << endl;
    ret out;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> &a) {
    for (auto &x: a) out << x << ' ';
    ret out;
}

template<typename T1, typename T2>
T1 min(T1 a, T2 b) {
    ret min(a, (T1) b);
}

template<typename T1, typename T2>
T1 max(T1 a, T2 b) {
    ret max(a, (T1) b);
}

template<typename T1, typename T2>
void amin(T1 &a, T2 b) {
    a = min(a, (T1) b);
}

template<typename T1, typename T2>
void amax(T1 &a, T2 b) {
    a = max(a, (T1) b);
}

void solve();

ld getTime() {
    ret (ld) clock() / CLOCKS_PER_SEC;
}

mt19937_64 rn(chrono::steady_clock::now().time_since_epoch().count());

ll rnd(ll l, ll r) {
    ret rn() % (r - l) + l;
}

signed main(int argc, char *argv[]) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout.precision(12);
    cout << fixed;
    if (local && argc == 1) {
        freopen("input.txt", "r", stdin);
    }
    ll T = 1;
//    cin >> T;
    while (T--) {
        solve();
    }
    if (local && argc == 1) {
        cout << endl << getTime();
    }
}

const ll N = 5e3 + 5;

ll n, m, k, q, n1, m1, a[N], b[N], ia, ib, dp[N][N], nxta[N][N], nxtb[N][N];

void solve() {
    cin >> n >> n1 >> m >> m1 >> k >> q;
    ll d1 = 0, d2 = 0;
    for0(i, n1) {
        ll d, x;
        cin >> d >> x;
        while (d >= 2000) d -= 2000, n -= 2000, d1++;
        x--;
        while (d--) a[ia++] = x;
    }
    for0(i, m1) {
        ll d, x;
        cin >> d >> x;
        while (d >= 2000) d -= 2000, m -= 2000, d2++;
        x--;
        while (d--) b[ib++] = x;
    }
    for0(i, k) nxta[n][i] = n, nxtb[m][i] = m;
    rfor0(i, n) {
        for0(j, k) nxta[i][j] = (a[i] == j ? i : nxta[i + 1][j]);
    }
    rfor0(i, m) {
        for0(j, k) nxtb[i][j] = (b[i] == j ? i : nxtb[i + 1][j]);
    }
    dp[n][m] = 0;
    rfor0(i, n) {
        ll c0 = 0, c1 = k;
        rfor0(j, m) {
            ll x = b[j];
            if (nxtb[j + 1][x] == m || nxta[i][x] == n) c1--;
            else if (dp[nxta[i][x] + 1][nxtb[j + 1][x] + 1]) c1--;
            else c0--;

            if (nxtb[j][x] == m || nxta[i][x] == n) c1++;
            else if (dp[nxta[i][x] + 1][nxtb[j][x] + 1]) c1++;
            else c0++;

            dp[i][j] = (c0 > 0);
        }
    }
    while (q--) {
        ll x, y;
        cin >> x >> y;
        if (x - 2000 * d1 >= 0) x -= 2000 * d1;
        else x %= 2000;
        if (y - 2000 * d2 >= 0) y -= 2000 * d2;
        else y %= 2000;
        cout << (dp[x][y] ? "Yes" : "No") << endl;
    }
}