
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define int ll
#define mod 1000000007
#define modf -1
#define all(a) a.begin(), a.end()
#define infl 1000000000000000009
#define inf 1000000009

int f(int i,int j,int ch,vector<vector<int>> &nexta,vector<vector<int>> &nextb,vector<vector<int>> &zn_p)//kol0
{
    int pos1 = nexta[i][ch],pos2 = nextb[j][ch];
    if(pos1 == -1 || pos2 == -1)
        return 0;
    if(zn_p[pos1][pos2] == 0)
        return 1;
    return 0;
}
signed main()
{
#ifdef LOCAL
    FILE* stream1; freopen_s(&stream1, "input.txt", "r", stdin);
#else
    cin.tie(); cout.tie(); ios::sync_with_stdio(0);
#endif
    //ull st = clock();
    //*****************************
    int N,n,M,m,k,q;
    cin >>N>>n>>M>>m>>k>>q;
    N++;M++;
    vector<int> a(N),b(M);
    {
        int pos = 1;
        for(int i = 0;i < n;i++)
        {
            int l,v;
            cin >>l>>v;v--;
            for(int j = pos;j < pos + l;j++)
                a[j] = v;
            pos += l;
        }
        pos = 1;
        for(int i = 0;i < m;i++)
        {
            int l,v;
            cin >>l>>v;v--;
            for(int j = pos;j < pos + l;j++)
                b[j] = v;
            pos += l;
        }
    }
    vector<vector<int>> nexta(N,vector<int>(k,-1)),nextb(M,vector<int>(k,-1));
    for(int i = N-2;i >= 0;i--)
    {
        for(int j = 0;j < k;j++)
            nexta[i][j] = nexta[i+1][j];
        nexta[i][a[i+1]] = i+1;
    }
    for(int i = M-2;i >= 0;i--)
    {
        for(int j = 0;j < k;j++)
            nextb[i][j] = nextb[i+1][j];
        nextb[i][b[i+1]] = i+1;
    }
    vector<vector<int>> zn_p(N,vector<int>(M)),kol0(N,vector<int>(M));
    for(int i = N-2;i >= 0;i--)
    {
        for(int j = M-2;j >= 0;j--)
        {
            int now = kol0[i][j+1] - f(i,j+1,b[j+1],nexta,nextb,zn_p);
            now += f(i,j,b[j+1],nexta,nextb,zn_p);
            kol0[i][j] = now;
            if(kol0[i][j])
                zn_p[i][j] = 1;
            else
                zn_p[i][j] = 0;
        }
    }
    for(int uuu = 0;uuu < q;uuu++)
    {
        int x,y;
        cin >>x>>y;
        if(zn_p[x][y])
            cout <<"Yes\n";
        else
            cout <<"No\n";
    }
    //*****************************
    //ull end = clock();
    //cout <<(end-st);
}