#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int N,n,M,m,k,q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<int> a;
    vector<int> b;
    set<int> s;
    for (int i = 0;i < n;i++) {
        int x,l;
        cin >> l >> x;
        s.insert(x);
        for (int j = 0;j < l;j++) {
            a.push_back(x);
        }
    }
    for (int i = 0;i < n;i++) {
        int x,l;
        cin >> l >> x;
        s.insert(x);
        for (int j = 0;j < l;j++) {
            b.push_back(x);
        }
    }
    vector<vector<int>> nexta(N,vector<int> (1601,N));
    for (int i = N-1;i>=0;i--) {
        for (int j = 0;j <= 1600;j++) {
            if (j==a[i]) {
                nexta[i][j] = i;
            }
            else if (i!=N-1) {
                nexta[i][j] = nexta[i+1][j];
            }
        }
    }
    vector<vector<int>> nextb(N,vector<int> (1601,N));
    for (int i = M-1;i>=0;i--) {
        for (int j = 0;j <= 1600;j++) {
            if (j==b[i]) {
                nextb[i][j] = i;
            }
            else if (i!=M-1) {
                nextb[i][j] = nextb[i+1][j];
            }
        }
    }
    vector<vector<int>> dp(N,vector<int> (M,0));
    for (int i = N-1;i >= 0;i--) {
        for (int j = M-1;j>=0;j--) {
            for (auto k:s) {
                int ii = nexta[i][k];
                int jj = nextb[j][k];
                //cout << i << ' ' << j << ' ' << k << ' ' << ii << ' ' << jj << '\n';
                if (ii==N or jj==M) {
                    continue;
                }
                if (ii==N-1 or jj==M-1) {
                    dp[i][j] = true;
                    break;
                }
                if (dp[ii+1][jj+1]==0) {
                    dp[i][j] = true;
                    break;
                }
            }
        }
    }
    /*for (auto x:dp) {
        for (auto y:x) {
            cout << y << ' ';
        }
        cout << '\n';
    }*/
    for (int i = 0;i < q;i++) {
        int xa,xb;
        cin >> xa >> xb;
        if (dp[xa][xb]) {
            cout << "Yes\n";
        }
        else {
            cout << "No\n";
        }
    }
    return 0;
}
