#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>
#include <ctime>
#include <chrono>
#include <cassert>
#include <vector>
#include <string>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <deque>
#include <bitset>
#include <queue>
using namespace std;
mt19937_64 rnd(time(NULL));

const long long INF = 1e18, MOD = 1e9 + 7;

void solve()
{
	long long ns, n, ms, m, k, q;
	cin >> ns >> n >> ms >> m >> k >> q;
	vector<long long> a, b;
	a.reserve(ns);
	b.reserve(ms);
	long long lena = 0, toa = 0;
	for (long long i = 0; i < n; i++)
	{
		long long len, val;
		cin >> len >> val;
		if (i == 0)
		{
			lena = len;
			len = min(len, 501ll);
			toa = len;
		}
		val--;
		while (len--)
		{
			a.push_back(val);
		}
	}
	long long lenb = 0, tob = 0;
	for (long long i = 0; i < m; i++)
	{
		long long len, val;
		cin >> len >> val;
		if (i == 0)
		{
			lenb = len;
			len = min(len, 501ll);
			tob = len;
		}
		val--;
		while (len--)
		{
			b.push_back(val);
		}
	}

	vector<vector<bool>> dp(ns + 1, vector<bool>(ms + 1, false));
	vector<long long> nxta(k, ns);
	for (long long i = ns; i > -1; i--)
	{
		if (i < ns)
		{
			nxta[a[i]] = i;
		}
		vector<long long> nxtb(k, ms);
		vector<long long> win(k);
		long long cntlose = 0;
		for (long long j = ms; j > -1; j--)
		{
			if (j < ms)
			{
				long long val = b[j];
				if (win[val] == -1)
				{
					cntlose--;
				}
				nxtb[b[j]] = j;
				if (nxta[val] != ns && nxtb[val] != ms)
				{
					if (!dp[nxta[val] + 1][nxtb[val] + 1])
					{
						win[val] = -1;
						cntlose++;
					}
					else
					{
						win[val] = 1;
					}
				}
			}
			if (cntlose)
			{
				dp[i][j] = true;
			}
		}
	}

	while (q--)
	{
		long long x, y;
		cin >> x >> y;
		long long dista = -1, distb = -1;
		if (x >= lena)
		{
			x -= lena;
			x += toa;
		}
		else
		{
			dista = lena - x;
		}
		if (y >= lenb)
		{
			y -= lenb;
			y += tob;
		}
		else
		{
			distb = lenb - x;
		}

		long long sub = 0;
		if (dista != -1 && distb != -1)
		{
			sub = min(dista, distb) / 2;
			dista -= sub * 2;
			distb -= sub * 2;
		}
		if (dista != -1)
		{
			dista %= 2;
			x = toa - dista;
		}
		if (distb != -1)
		{
			distb %= 2;
			y = tob - distb;
		}

		cout << (dp[x][y] ? "Yes\n" : "No\n");
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}

	return 0;
}

/*

























*/
