#include <bits/stdc++.h>
using namespace std;
//#define int long long
//map <pair <int, int>, int> cnt;
//int cnt[5010][5010];
bool dp[5010][5010];
vector <int> a, b;
/*bool check(int as, int bs,int k){
    if (cnt[as][bs]){
        return (bool)(cnt[as][bs] - 1);
    }
    vector <int> inda(k + 1), indb(k + 1);
    for (int i = a.size() - as; i < a.size(); ++i){
        inda[a[i]] = 1;
    }
    bool f = 0;
    for (int i = b.size() - bs; i < b.size(); ++i){
        if (inda[a[i]]){
            f = 1;
            break;
        }
    }
    if (!f){
        return false;
    }
    for (int i = a.size() - as; i < a.size(); ++i){
        inda[a[i]] = 0;
    }
    for (int i = a.size() - as; i < a.size(); ++i){
        if (!inda[a[i]]){
            inda[a[i]] = i + 1;
        }
    }
    for (int i = b.size() - bs; i < b.size(); ++i){
        if (!indb[b[i]]){
            indb[b[i]] = i + 1;
        }
    }
    for (int i = 1; i <= k; ++i){
        if (inda[i] && indb[i]){
            /*vector <int> c, d;
            for (int j = inda[i]; j < a.size(); ++j){
                c.push_back(a[j]);
            }
            for (int j = indb[i]; j < b.size(); ++j){
                d.push_back(b[j]);
            }
            bool f = check(a.size() - inda[i], b.size() - indb[i], k);
            if (!f){
                cnt[as][bs] = 2;
                return true;
            }
        }
    }
    cnt[as][bs] = 1;
    return false;
}*/
void solve(){
    int n, n1, m, m1, k, q;
    cin >> n >> n1 >> m >> m1 >> k >> q;
    vector <pair <int, int>> a1(n1);
    for (int i = 0; i < n1; ++i){
        cin >> a1[i].first >> a1[i].second;
    }
    vector <pair <int, int>> b1(m1);
    for (int i = 0; i < m1; ++i){
        cin >> b1[i].first >> b1[i].second;
    }
    for (int i = 0; i < n1; ++i){
        for (int j = 0; j < a1[i].first; ++j){
            a.push_back(a1[i].second);
        }
    }
    for (int i = 0; i < m1; ++i){
        for (int j = 0; j < b1[i].first; ++j){
            b.push_back(b1[i].second);
        }
    }
    vector <int> inda(k + 1);
    vector <int> indb(k + 1);
    int cnt = 0;
    for (int i = n - 1; i >= 0; --i){
        if (inda[a[i]] && indb[a[i]]){
            cnt -= !dp[inda[a[i]]][indb[a[i]]];
        }
        inda[a[i]] = i + 1;
        if (inda[a[i]] && indb[a[i]]){
            cnt += !dp[inda[a[i]]][indb[a[i]]];
        }
        for (int j = m - 1; j >= 0; --j){
            if (inda[b[j]] && indb[b[j]]){
                cnt -= !dp[inda[b[j]]][indb[b[j]]];
            }
            indb[b[j]] = j + 1;
            if (inda[b[j]] && indb[b[j]]){
                cnt += !dp[inda[b[j]]][indb[b[j]]];
            }
            dp[i][j] = (cnt != 0);
        }
    }
    while (q--){
        int x, y;
        cin >> x >> y;
        /*vector <int> c, d;
        for (int j = x; j < a.size(); ++j){
            c.push_back(a[j]);
        }
        for (int j = y; j < b.size(); ++j){
            d.push_back(b[j]);
        }*/
        bool ans = dp[x][y];
        if (ans){
            cout << "Yes\n";
        }
        else{
            cout << "No\n";
        }
    }
}
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    //cin >> t;
    while (t--){
        solve();
    }
}


