#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#define endl '\n'
//#define int long long

using namespace std;

map<pair<int, int>, int> dp;
vector<int> a, b;

void cur(int i, int j) {
    if (i == (int)a.size() - 1 || j == (int)b.size() - 1) {
        dp[{i, j}] = false;
        return;
    }
    if (dp.find({i, j}) != dp.end()) {
        return;
    }
    unordered_map<int, int> ind1, ind2;
    for (int x = i + 1; x < (int)a.size(); ++x) {
        if (ind1.find(a[x]) == ind1.end()) {
            ind1[a[x]] = x;
        }
    }
    for (int x = j + 1; x < (int)b.size(); ++x) {
        if (ind2.find(b[x]) == ind2.end()) {
            ind2[b[x]] = x;
        }
    }
    bool found = false;
    for (auto it = ind1.begin(); it != ind1.end(); ++it) {
        int numb = (it -> first);
        int pos1 = (it -> second);
        if (ind2.find(numb) != ind2.end()) {
            int pos2 = ind2[numb];
            cur(pos1, pos2);
            if (!dp[{pos1, pos2}]) {
                found = true;
            }
        }
    }
    dp[{i, j}] = found;
}

void solve(vector<pair<int, int>> q, vector<pair<int, int>> w, int l, int r) {
    a.clear();
    b.clear();
    vector<pair<int, int>> c, d;
    int z = 0;
    while (z < (int)q.size()) {
        int x = min(l, q[z].first);
        l -= x;
        q[z].first -= x;
        if (q[z].first > 0) {
            c.push_back(q[z]);
        }
        z++;
    }
    z = 0;
    while (z < (int)w.size()) {
        int x = min(r, w[z].first);
        r -= x;
        w[z].first -= x;
        if (w[z].first > 0) {
            d.push_back(w[z]);
        }
        z++;
    }
    for (int i = 0; i < (int)c.size(); ++i) {
        for (int j = 0; j < (int)c[i].first; ++j) {
            a.push_back(c[i].second);
        }
    }
    for (int i = 0; i < (int)d.size(); ++i) {
        for (int j = 0; j < (int)d[i].first; ++j) {
            b.push_back(d[i].second);
        }
    }
    dp.clear();
    cur(-1, -1);
    if (dp[{-1, -1}]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n, m, k, q;
    cin >> n >> n >> m >> m >> k >> q;
    vector<pair<int, int>> aa, bb;
    int l, v;
    for (int i = 0; i < n; ++i) {
        cin >> l >> v;
        aa.push_back({l, v});
    }
    for (int i = 0; i < m; ++i) {
        cin >> l >> v;
        bb.push_back({l, v});
    }
    for (int i = 0; i < q; ++i) {
        cin >> l >> v;
        solve(aa, bb, l, v);
    }
    return 0;
}
