#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int>a(N);
    vector<int>b(M);
    int ind = 0;
    int l, v;
    for(int i = 0; i < n; i++)
    {
        cin >> l >> v;
        v--;
        while(l)
        {
            l--;
            a[ind] = v;
            ind++;
        }
    }
    ind = 0;
    for(int i = 0; i < m; i++)
    {
        cin >> l >> v;
        v--;
        while(l)
        {
            l--;
            b[ind] = v;
            ind++;
        }
    }
    vector<vector<int>>ar(k, vector<int>(N));
    for(int i = 0; i < k; i++)
    {        
        l = -1;
        for(int j = N - 1; j > -1; j--)
        {
            ar[i][j] = l;
            if(a[j] == i)
            {
                l = j;
            }
        }
    }
    vector<vector<int>>br(k, vector<int>(M));
    for(int i = 0; i < k; i++)
    {        
        l = -1;
        for(int j = M - 1; j > -1; j--)
        {
            br[i][j] = l;
            if(b[j] == i)
            {
                l = j;
            }
        }
    }
    vector<vector<int>>gran(N, vector<int>(M));
    set<int>s;
    vector<int>game(k + 1);
    int x, y;
    for(int i = N - 2; i > -1; i--)
    {
        for(int j = 0; j <= k + 1; j++)
        {
            s.insert(j);
        }
        game.assign(k + 2, 0);
        for(int j = M - 2; j > -1; j--)
        {
            if(a[i] != b[j])
            {
                continue;
            }
            x = b[j + 1];
            if(ar[x][i] != -1)
            {
                if(br[x][j + 1] != -1)
                {
                    if(game[gran[ar[x][i]][br[x][j + 1]]] == 1)
                    {
                        s.insert(gran[ar[x][i]][br[x][j + 1]]);
                    }
                    game[gran[ar[x][i]][br[x][j + 1]]]--;
                }
                y = j + 1;
                x = ar[x][i];
                s.erase(gran[x][y]);
                game[gran[x][y]]++;
            }
            gran[i][j] = *s.begin();
        }
    }
    while(q)
    {
        cin >> x >> y;
        q--;
        int f = 0;
        for(int i = 0; i < k; i++)
        {
            if(i == a[x])
            {
                if(gran[x][y] == 0)
                { 
                   f = 1;
                    cout << "Yes" << endl;
                    break;
                }
            }
            else if(br[i][y] != -1 && ar[i][x] != -1 && gran[ar[i][x]][br[i][y]] == 0)
            {
                f = 1;
                cout << "Yes" << endl;
                break;
            }
        }
        if(f == 0)
        {
            cout << "No" << endl;
        }
    }
}