#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <climits>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = int;
using ld = long double;
using pii = pair<ll, ll>;

#define all(v) v.begin(), v.end()
#define len(v) (ll)v.size()

mt19937 rnd(525252);

const ll INF = 1e9, SZ = 2e3, MOD = 1e9 + 7;
const ld eps = 1e-8, pi = acosl(-1);

ll k;

vector<vector<ll>>va, vb;
map<ll, bool>mp;

vector<pii>a, b;

ll hs(ll ax, ll ay, ll bx, ll by){
    return (((ax * SZ + ay) * SZ + bx) * SZ) + by;
}

bool gen(ll ax, ll ay, ll bx, ll by) {
//    cout << ax << ' ' << ay << ' ' << bx << ' ' << by << '\n';
    if (ax == len(a) || bx == len(b)) {
        return false;
    }
    if (ay == -1) ay = a[ax].first;
    if (by == -1) by = b[bx].first;



    if (ay == 0 || by == 0) {
        if (ay == 0) {
            ax++;
            ay = -1;
        }
        if (by == 0) {
            bx++;
            by = -1;
        }
        return gen(ax, ay, bx, by);
    }


//    ll hh = hs(ax, ay, bx, by);
//    if (mp.find(hh) != mp.end()) return mp[hh];

    if (a[ax].second == b[bx].second) {
        ll t = min(ay, by);
        ay -= t;
        by -= t;
        return gen(ax, ay, bx, by) ^ (t % 2);
    }

    for (ll col = 0; col < k; ++col) {
        ll z = lower_bound(all(vb[col]), bx) - vb[col].begin();
        ll j = lower_bound(all(va[col]), ax) - va[col].begin();
        if (z != len(vb[col]) && j != len(vb[col]) &&
            !gen(j, (j == ax ? ay - 1 : a[j].first), z, (z == bx ? by - 1 : b[z].first)))
            return true;
    }
    return false;
}

void solve() {
    ll N, n, M, m, q;
    cin >> N >> n >> M >> m >> k >> q;
    va.resize(k); vb.resize(k);
    for (ll i = 0; i < n; ++i){
        ll l, v; cin >> l >> v; v--;
        a.emplace_back(l, v);
        va[v].push_back(i);
    }

    for (ll i = 0; i < m; ++i){
        ll l, v; cin >> l >> v; v--;
        b.emplace_back(l, v);
        vb[v].push_back(i);
    }

    while (q--){
        ll x, y;
        cin >> x >> y;
        ll ax = 0, ay = a[0].first, bx = 0, by = b[0].first;
        while (x){
            if (ay <= x){
                x -= a[ax].first;
                ax++;
                ay = a[ax].first;
            }
            else{
                ay -= x;
                x = 0;
            }
        }
        while (y){
            if (by <= y){
                y -= b[bx].first;
                bx++;
                by = b[bx].first;
            }
            else{
                by -= y;
                y = 0;
            }
        }
//        cout << ax << ' ' << ay << ' ' << bx << ' ' << by << '\n';
        if (gen(ax, ay, bx, by)) cout << "Yes";
        else cout << "No";
        cout << '\n';
    }
}

int main()
{
	ll t = 1;

//	freopen("in.txt", "r", stdin);
//	freopen("out.txt", "w", stdout);
//    cin >> t;

	while (t--) {
		solve();
		cout << '\n';
	}
}
