#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<unordered_set>
#include<unordered_map>
#include<iomanip>
#include<random>
#include<bitset>
#include<ctime>

#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2")

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using uint = unsigned int;

ll gcd(ll a, ll b) {
	return b == 0 ? a : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
mt19937 mt(time(0));
const int N = 1602, inf = 1e9 + 100, mod = 1e9 + 7, mod2 = 998244353, P = 257;
const ll llinf = 1e18 + 100;
bool dp[N][N];
int cn, n, cm, m, k, q, a[N], b[N], lena[N], lenb[N], nxt1[N][N], nxt2[N][N];

void solve() {
	cin >> n >> cn >> m >> cm >> k >> q;
	for (int i = 0; i < cn; ++i) {
		cin >> lena[i] >> a[i], --a[i];
	}
	for (int i = 0; i < cm; ++i) {
		cin >> lenb[i] >> b[i], --b[i];
	}
	for (int i = 0; i < k; ++i) nxt1[n][i] = n, nxt2[m][i] = m;
	for (int i = n - 1; i >= 0; --i) {
		for (int j = 0; j < k; ++j) {
			nxt1[i][j] = a[i] == j ? i : nxt1[i + 1][j];
		}
	}
	for (int i = m - 1; i >= 0; --i) {
		for (int j = 0; j < k; ++j) {
			nxt2[i][j] = b[i] == j ? i : nxt2[i + 1][j];
		}
	}
	for (int i = n - 1; i >= 0; --i) {
		int cnt = 0;
		for (int j = m - 1; j >= 0; --j) {
			if (a[i] == b[j]) {
				if (cnt) dp[i][j] = true;
			}
			else {
				int to1 = nxt1[i][b[j]];
				if (to1 != n) {
					cnt += (dp[to1][j] == 0 && min(lena[to1], lenb[j]) % 2 == 0);
					/*if (nxt2[j][b[j]] != m) {
						int to2 = nxt2[j][b[j]];
						if (dp2[to1][to2] == 0) --cnt;
					}*/
				}
			}
		}
	}
	cin >> q;
	while (q--) {
		int x, y;
		cin >> x >> y;
		int i = 0, j = 0, l1 = 0, l2 = 0;
		while (l1 + lena[i] <= x) {
			l1 += lena[i++];
		}
		while (l2 + lenb[j] <= y) {
			l2 += lenb[j++];
		}
		if (dp[x][y] || min(l1 + lena[i] - x, l2 + lenb[j] - y) % 2 == 1) cout << "Yes\n";
	}
}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int tt = 1;
	//cin >> tt;
	while (tt--) {
		solve();
		cout << '\n';
		cout.flush();
	}
	return 0;
}