#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <unordered_map>
using namespace std;

template<typename T1,typename T2>
istream&operator>>(istream&in,pair<T1,T2>&a){
    return in>>a.first>>a.second;
}
template<typename T1,typename T2>
ostream&operator<<(ostream&out,const pair<T1,T2>&a){
    return out<<a.first<<' '<<a.second<<'\n';
}
template<typename T>
istream&operator>>(istream&in,vector<T>&a){
    for (auto &i:a)in>>i;
    return in;
}
template<typename T>
ostream&operator<<(ostream&out,const vector<T>&a){
    for (const auto &i:a)out<<i<<' ';
    return out;
}
template<typename T>
ostream&operator<<(ostream&out,const vector<vector<T>>&a){
    for (const auto &i:a)out<<i<<'\n';
    return out;
}
typedef int ll;
const int inf =1e9+7;
void print(bool flag){
if (flag)cout<<"YES\n";
else cout<<"NO\n";
}
struct solve{
    int N,M,K;
    int n,m,q;
    vector<pair<ll,ll>>a;
    vector<pair<ll,ll>>b;
    unordered_map<ll,ll>mpa;
    unordered_map<ll,ll>mpb;
    solve(){
        cin>>N>>n>>M>>m>>K>>q;
        a.resize(n);
        b.resize(m);
        cin>>a>>b;
        for (auto &x:a)swap(x.first,x.second);
        for (auto &x:b)swap(x.first,x.second);
        while (q--){
            mpa.clear();
            mpb.clear();
            int x,y;
            cin>>x>>y;
            ll pref=0;

            for (int i=0;i<n;i++){
                if (pref>=x)mpa[a[i].first]=a[i].second;
                else{
                    if (pref+a[i].second>x)mpa[a[i].first]=pref+a[i].second-x;
                    pref+=a[i].second;
                }
            }
            pref=0;
            for (int i=0;i<m;i++){
                if (pref>=y)mpb[b[i].first]=b[i].second;
                else{
                    if (pref+b[i].second>y)mpb[b[i].first]=pref+b[i].second-y;
                    pref+=b[i].second;
                }
            }
            bool flag=false;
            for (int i=n-1;i>=0;i--){
                ll d=min(mpa[a[i].first],mpb[a[i].first]);
                //cout<<mpa[a[i].first]<<' '<<mpb[a[i].first]<<'\n';
                if (d%2==1)flag=true;
            }
            print(flag);
        }
    }
};
int main()
{
    int t=1;
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    while(t--)solve();
}
