#include <bits/stdc++.h>

using namespace std;

// #define int long long
using ld = long double;
using ll = long long;
using pii = pair<int, int>;

void solve()
{
    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    // dp[i][j] = выигрышная
    vector<vector<bool>> dp(N, vector<bool>(M, false));
    vector<int> a(N);
    vector<int> b(M);
    int p = 0;
    for (int i = 0; i < n; ++i)
    {
        int l;
        int v;
        cin >> l >> v;
        --v;
        for (int c = 0; c < l; ++c, ++p)
        {
            a[p] = v;
        }
    }
    p = 0;
    for (int i = 0; i < m; ++i)
    {
        int l;
        int v;
        cin >> l >> v;
        --v;
        for (int c = 0; c < l; ++c, ++p)
        {
            b[p] = v;
        }
    }
    vector<int> apos(k, -1);
    for (int i = N - 1; i >= 0; --i)
    {
        vector<int> bpos(k, -1);

        int cnt_lose = 0;

        auto set_bpos = [&](int el, int pos)
        {
            if (apos[el] != -1 && bpos[el] != -1 && dp[apos[el]][bpos[el]] == false)
            {
                --cnt_lose;
            }
            bpos[el] = pos;
            if (apos[el] != -1 && dp[apos[el]][bpos[el]] == false)
            {
                ++cnt_lose;
            }
        };

        for (int j = M - 1; j >= 0; --j)
        {
            if (cnt_lose == 0)
            {
                dp[i][j] = false;
            }
            else
            {
                dp[i][j] = true;
            }
            set_bpos(b[j], j);
        }
        apos[a[i]] = i;
    }
    for (int qq = 0; qq < q; ++qq)
    {
        int x, y;
        cin >> x >> y;
        bool win = dp[x][y];
        if (!win)
        {
            cout << "Yes" << '\n';
        }
        else
        {
            cout << "No" << '\n';
        }
    }
}

signed main()
{
#ifdef ROMALOCAL
    freopen("in.txt", "r", stdin);
#endif

    cin.tie(0);
    ios::sync_with_stdio(0);

    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}