#define _CRT_SECURE_NO_WARNINGS


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>


using namespace std;
using ll=long long;
const ll inf = 1e6;


int a[1600001];
int b[1600001];
int ans[100001];
int preans[100001];
int lena[100001];
int lenb[100001];
int main() {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll N, n, M, m, k, q;
	cin >> N >> n >> M >> m >> k >> q;
	ll suml = 0;
	vector<int> va(n + 1);
	vector<int> la(n + 1);
	vector<int> vb(m+ 1);
	vector<int> lb(m+ 1);
	for (int i = 1; i <= n; ++i) {
		ll l, v;
		cin >> l >> v;
		va[n-i+1] = v;
		la[n-i+1] = l;
		for (int j = suml + 1; j <= suml + l; ++j) {
			a[N-j+1] = v;
		}
		suml += l;
		lena[v] = N-suml;
	}
	suml = 0;
	for (int i = 1; i <= m; ++i) {
		ll l, v;
		cin >> l >> v;
		lenb[v] = suml;
		vb[m-i+1] = v;
		lb[m-i+1] = l;
		for (int j = suml + 1; j <= suml + l; ++j) {
			b[M-j+1] = v;
		}
		suml += l;
		lenb[v] = M - suml;
	}
	vector<int> was(k + 1);
	for (int i = 1; i <= n; ++i) {
		int fl = 0;
		was[va[i]] = 1;
		for (int j = 1; j <= m; ++j) {
			if (vb[j] == va[i]) {
				preans[va[i]] = fl;
				int m = min(la[i], la[j]);
				m -= 1;
				if (m % 2 != 0) {
					ans[va[j]] = 1;
				}
				break;
			}
			else {
				if (was[vb[j]] == 1) {
					fl = max(fl, ans[vb[j]]);
				}
			}
		}
	}
	for (int i = 1; i <= q; ++i) {
		ll x, y;
		cin >> x >> y;
		ll c = a[N - x];
		if (preans[c] == 1) {
			cout << "Yes" << "\n";
		}
		else {
			int m = min(N - x - lena[c], M - y - lenb[c]);
			if (m % 2 != 0) {
				cout << "Yes" << "\n";
			}
			else {
				cout << "No" << "\n";
			}
		}
	}
}