#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

#define int long long

const int NM = 302;
const int K = 162;

static int win[NM][NM][K];
static int los[NM][NM][K];
static int pwin[NM][NM];
static int plos[NM][NM];

signed main() {
	memset(win, 0, sizeof win);
	memset(los, 0, sizeof los);
	memset(pwin, 0, sizeof pwin);
	memset(plos, 0, sizeof plos);

	int N, n, M, m, k, q;
	cin >> N >> n >> M >> m >> k >> q;
	vector <pair <int, int>> a;
	for (int i = 0; i < n; i++) {
		int l, v;
		cin >> l >> v;
		a.push_back({ l, v });
	}
	vector <pair <int, int>> b;
	for (int i = 0; i < m; i++) {
		int l, v;
		cin >> l >> v;
		b.push_back({ l, v });
	}

	for (int i = n - 1; i >= 0; i--) {
		for (int j = m - 1; j >= 0; j--) {
			if (a[i].second != b[j].second) continue;
			int mxcnt = min(a[i].first, b[j].first);
			for (int k = mxcnt; k >= 0; k--) {
				int wcnt = pwin[i][j];
				int lcnt = plos[i][j];
				if (k < mxcnt) {
					wcnt += win[i][j][k + 1];
					lcnt += los[i][j][k + 1];
				}
				if (wcnt + lcnt == 0) {
					win[i][j][k] = 1;
					continue;
				}
				if (lcnt) {
					win[i][j][k] = 1;
				}
				else {
					los[i][j][k] = 1;
				}
			}
		}
	}
	vector <int> pal(n + 1);
	for (int i = 0; i < n; i++) {
		pal[i + 1] = pal[i] + a[i].first;
	}
	vector <int> pbl(m + 1);
	for (int i = 0; i < m; i++) {
		pbl[i + 1] = pbl[i] + b[i].first;
	}

	while (q--) {
		int x, y;
		cin >> x >> y;
		int i = --upper_bound(pal.begin(), pal.end(), x) - pal.begin();
		int j = --upper_bound(pbl.begin(), pbl.end(), y) - pbl.begin();
		int rimasto = min(a[i].first - (x - pal[i]), b[j].first - (y - pbl[j]));
		int k = min(a[i].first, b[j].first) - rimasto + 1;
		if (win[i][j][k]) {
			cout << "Yes\n"; 
		}
		else {
			cout << "No\n";
		}
	}
}