#include <iostream>
#include <vector>
#include <map>
#include <random>
#include <set>
#include <algorithm>
#include <assert.h>
using namespace std;

#define int long long
#define ll long long
#define vi vector<int>
#define pi pair<int, int>
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define vpi vector<pi>
#define vvi vector<vi>

bool cmp(int a, int b) {
	return abs(a) < abs(b);
}

signed main() {

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n, nt, m, mt, k, q;
	cin >> n >> nt >> m >> mt >> k >> q;
	vi a;
	vi b;
	set<int> s;
	while (nt--) {
		int x, y;
		cin >> x >> y;
		while (x--) a.push_back(y);
	}
	while (mt--) {
		int x, y;
		cin >> x >> y;
		while (x--) b.push_back(y);
	}
	vvi ida(k + 1, vi());
	vvi idb(k + 1, vi());
	for (int i = 0; i < n; i++) {
		ida[a[i]].push_back(i);
	}
	for (int i = 0; i < m; i++) {
		idb[b[i]].push_back(i);
	}
	
	vector<vector<bool>> dp(n, vector<bool>(m, 1));
	for (int i = n - 1; i > -1; i--) {
		for (int j = m - 1; j > -1; j--) {
			for (int t = 1; t <= k; t++) {
				auto iti = upper_bound(all(ida[t]), i);
				auto itj = upper_bound(all(idb[t]), j);
				if (iti == ida[t].end()) continue;
				if (itj == idb[t].end()) continue;
				if (dp[*iti][*itj]) {
					dp[i][j] = 0;
					break;
				}
			}
		}
	}
	vector<vector<bool>> pdp(n, vector<bool>(m));

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			for (int t = 0; t <= k; t++) {
				auto iti = lower_bound(all(ida[t]), i);
				auto itj = lower_bound(all(idb[t]), j);
				if (iti == ida[t].end()) continue;
				if (itj == idb[t].end()) continue;
				if (dp[*iti][*itj]) {
					pdp[i][j] = 1;
					break;
				}
			}
		}
	}

	while (q--) {
		int x, y;
		cin >> x >> y;
		if (pdp[x][y]) {
			cout << "Yes\n";
		}
		else {
			cout << "No\n";
		}
	}
}