#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <array>
#include <queue>

using namespace std;
typedef long long ll;
typedef long double ld;
#define all(a) a.begin(), a.end()
const ll INF = 1e18;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll N, n, M, m, k, q;
	cin >> N >> n >> M >> m >> k >> q;
	vector<ll> va(n), la(n), smla(n + 1, 0), vb(m), lb(m), smlb(m + 1, 0);
	for (ll i = 0; i < n; i++) {
		cin >> la[i] >> va[i];
		va[i]--;
		smla[i + 1] = smla[i] + la[i];
	}
	for (ll i = 0; i < m; i++) {
		cin >> lb[i] >> vb[i];
		vb[i]--;
		smlb[i + 1] = smlb[i] + lb[i];
	}
	vector<vector<ll>> nxta(n, vector<ll>(k, n)), nxtb(m, vector<ll>(k, m));
	vector<ll> nowa(k, n), nowb(k, n);
	for (ll i = n - 1; i >= 0; i--) {
		nxta[i] = nowa;
		nowa[va[i]] = i;
	}
	for (ll i = m - 1; i >= 0; i--) {
		nxtb[i] = nowb;
		nowb[vb[i]] = i;
	}
	vector<vector<char>> win(n + 1, vector<char>(m + 1, 0)), winoth(n + 1, vector<char>(m + 1, 0));
	for (ll i = 0; i <= n; i++) {
		win[i][m] = 1;
		winoth[i][m] = 1;
	}
	for (ll j = 0; j <= m; j++) {
		win[n][j] = 1;
		winoth[n][j] = 1;
	}
	for (ll i = n - 1; i >= 0; i--) {
		ll smok = 0;
		vector<char> ok(k, 1);
		for (ll j = m - 1; j >= 0; j--) {
			if (va[i] != vb[j]) {
				smok -= (ok[vb[j]] == 0);
				ok[vb[j]] = win[nxta[i][vb[j]]][j];
				smok += (ok[vb[j]] == 0);
				continue;
			}
			if (smok > 0) {
				winoth[i][j] = 1;
			}
			ll u = i, v = j;
			ll lenu = 1, lenv = 1;
			while (u < n && v < m) {
				ll l = max(lenu, lenv);
				if (winoth[u][v]) {
					win[i][j] = (l % 2 == 0);
					break;
				}
				if (lenu + la[u] == lenv + lb[v]) {
					win[i][j] = (win[u + 1][v + 1]) ^ ((lenu + la[u]) % 2 == 0);
					break;
				}
				if (lenu + la[u] < lenv + lb[v]) {
					lenu += la[u];
					u = nxta[u][va[u]];
				}
				else {
					lenv += lb[v];
					v = nxtb[v][vb[v]];
				}
			}
			if (u == n || v == m)
				win[i][j] = (max(lenu, lenv) % 2 == 1);
		}
	}
	while (q--) {
		ll x, y;
		cin >> x >> y;
		if (x == 4 && y == 5) {
			ll awoib = 0;
		}
		ll ustar = upper_bound(all(smla), x) - smla.begin() - 1;
		ll vstar = upper_bound(all(smlb), y) - smlb.begin() - 1;
		la[ustar] = smla[ustar + 1] - x + 1;
		lb[vstar] = smlb[vstar + 1] - y + 1;
		ll u = ustar, v = vstar;
		char res = 0;
		ll lenu = 1, lenv = 1;
		while (u < n && v < m) {
			ll l = max(lenu, lenv);
			if (winoth[u][v]) {
				res = (l % 2 == 0);
				break;
			}
			if (lenu + la[u] == lenv + lb[v]) {
				res = (win[u + 1][v + 1]) ^ ((lenu + la[u]) % 2 == 0);
				break;
			}
			if (lenu + la[u] < lenv + lb[v]) {
				lenu += la[u];
				u = nxta[u][va[u]];
			}
			else {
				lenv += lb[v];
				v = nxtb[v][vb[v]];
			}
		}
		if (u == n || v == m)
			res = (max(lenu, lenv) % 2 == 1);
		if (res) cout << "Yes\n";
		else cout << "No\n";
		la[ustar] = smla[ustar + 1] - smla[ustar];
		lb[vstar] = smlb[vstar + 1] - smlb[vstar];
	}
	return 0;
}