#include <bits/stdc++.h>

#define ll int
#define vl vector<ll>
#define pl pair<ll,ll>
#define pb push_back
#define all(x) x.begin(),x.end()

using namespace std;

ll N,n,M,m,k,q;
set<pl> a,b;
vl ocura[1700],ocurb[1700];
int geta_next(int val,int id)
{
	auto it=upper_bound(all(ocura[val]),id);
	int ans=N+1;
	if(it!=end(ocura[val]))ans=min(ans,*it);
	auto ip=a.upper_bound({id,k+1});
	if((ip==end(a) or ip->first>id+1) and (--ip)->second==val)ans=min(ans,id+1);
	return ans;
}
int getb_next(int val,int id)
{
	auto it=upper_bound(all(ocurb[val]),id);
	int ans=M+1;
	if(it!=end(ocurb[val]))ans=min(ans,*it);
	auto ip=b.upper_bound({id,k+1});
	if((ip==end(b) or ip->first>id+1) and (--ip)->second==val)ans=min(ans,id+1);
	return ans;
}
map<pl,bool> memo;
bool win(int x,int y)
{
	if(memo.find({x,y})!=memo.end())return memo[{x,y}];	
	bool wn=0;
	for(int i=1;i<=k;i++)
	{
		int inda=geta_next(i,x);
		int indb=getb_next(i,y);
		if(inda<=N and indb<=M)
		{
			wn|=!win(inda,indb);
			if(wn)break;
		}
	}
	return memo[{x,y}]=wn;
}

void solve()
{
	// Writing bruteforce solution first
	cin>>N>>n>>M>>m>>k>>q;
	ll sm=0;
	for(int i=0;i<n;i++)
	{
		ll l,x;
		cin>>l>>x;
		ocura[x].pb(sm+1);
		a.insert({sm+1,x});
		sm+=l;
	}
	sm=0;
	for(int i=0;i<m;i++)
	{
		ll l,x;
		cin>>l>>x;
		ocurb[x].pb(sm+1);
		b.insert({sm+1,x});
		sm+=l;
	}

	// i think no need of any kind of precomputation

	while(q--)
	{
		int x,y;
		cin>>x>>y;
		cout<<(win(x,y)?"Yes":"No")<<endl;
		// exit(0);
	}
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	// cin>>t;
	while(t--)
	{
		solve();
	}
}