#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <climits>
#include <time.h>
#include <cmath>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

using namespace std;
using ll = long long;
using ld = long double;
ll inf = 4e18;

//vector<vector<int>> ft, pos;
int n, m;
//
//void add(int x, int y) {
//	for (int i = x; i < n; i = i | (i + 1)) {
//		for (int j = y; j < m; j = j | (j + 1)) {
//			ft[i][j]++;
//		}
//	}
//}
//
//int getpref(int x, int y) {
//	int ans = 0;
//	for (int i = x; i >= 0; i = (i & (i + 1)) - 1) {
//		for (int j = y; j >= 0; j = (j & (j + 1)) - 1) {
//			ans += ft[i][j];
//		}
//	}
//}
//
//int getsuf(int x, int y) {
//	if (x == n || y == m)
//		return 0;
//	int ans = getpref(n - 1, m - 1);
//	ans -= getpref(n - 1, y - 1);
//	ans -= getpref(x - 1, m - 1);
//	ans += getpref(x - 1, y - 1);
//	return ans;
//}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int cn, cm, k, q;
	cin >> n >> cn >> m >> cm >> k >> q;
	vector<int> a, b;
	vector<int> range;
	vector<int> pos(k + 1, -1);
	vector<bool> used(k + 1, 0);
	for (int i = 0; i < cn; i++) {
		int l, v;
		cin >> l >> v;
		if (!used[v]) {
			range.push_back(v);
			pos[v] = range.size() - 1;
			used[v] = 1;
		}
		for (int j = 0; j < l; j++)
			a.push_back(v);
	}
	for (int i = 0; i < cm; i++) {
		int l, v;
		cin >> l >> v;
		if (!used[v]) {
			range.push_back(v);
			pos[v] = range.size() - 1;
			used[v] = 1;
		}
		for (int j = 0; j < l; j++)
			b.push_back(v);
	}
	vector<vector<bool>> posb(n + 1, vector<bool>(m + 1, 0));
	vector<vector<int>> anext(n, vector<int>(range.size(), -1));
	vector<vector<int>> bnext(m, vector<int>(range.size(), -1));
	anext[n - 1][pos[a[n - 1]]] = n - 1;
	bnext[m - 1][pos[b[m - 1]]] = m - 1;
	for (int i = n - 2; i >= 0; i--) {
		anext[i] = anext[i + 1];
		anext[i][pos[a[i]]] = i;
	}
	for (int i = m - 2; i >= 0; i--) {
		bnext[i] = bnext[i + 1];
		bnext[i][pos[b[i]]] = i;
	}
	//for (auto i : anext.back())
	//	cout << i << " ";
	//cout << endl;
	//for (auto j : bnext.back()) {
	//	cout << j << " ";
	//}
	//cout << endl;
	for (int sum = n + m; sum >= 0; sum--) {
		for (int x = 0; x < n; x++) {
			int y = sum - x;
			if (y < 0 || y >= m)
				continue;
			bool found = 0;
			for (int i = 0; i < range.size(); i++) {
				if (anext[x][i] != -1 && bnext[y][i] != -1) {
					if (posb[anext[x][i] + 1][bnext[y][i] + 1] == 0) {
						found = 1;
						break;
					}
				}
			}
			//cout << x << " " << y << " " << (int)found << endl;
			posb[x][y] = found;
		}
	}
	while (q--) {
		int x, y;
		cin >> x >> y;
		if (posb[x][y])
			cout << "Yes\n";
		else
			cout << "No\n";
	}
}