
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define ve vector
#define pb push_back
#define all(a) a.begin(), a.end()
#define first f
#define second s
using ld = long double;
#define int ll
mt19937 rnd(321932);

template<class A>
istream &operator>>(istream &in, ve<A> &a) {
    for (auto &x: a)
        in >> x;
    return in;
}

template<class A>
ostream &operator<<(ostream &out, ve<A> a) {
    for (auto &x: a)
        out << x << ' ';
    return out << '\n';
}

void sol() {
    int n, m;
    cin >> n >> m;
    ve<int> x(m);
    cin >> x;
    reverse(all(x));
    // dp[j] --- max res if we used j bad x
    ve<ve<int>> dp(m + 1, ve<int>(m + 1, -1e18));
    dp[0][0] = 0;
    for (int cnt = 1; cnt <= m; ++cnt) {
        cout << (cnt+1)/2 << ' ' << min(cnt, (cnt+n)/2) << '\n';
        for (int i = (cnt+1)/2; cnt + n >= 2 * i && i <= cnt; ++i) {
            dp[i][cnt] = max(dp[i][cnt-1], dp[i-1][cnt-1] + x[cnt-1]);
        }
    }
    int sum = 0;
    for (auto &c : x)
        sum += c;
    int mx = -1e18;
    for (int i = 0; i <= m; ++i)
        mx = max(mx, dp[i][m]);
    cout << 2 * mx - sum << '\n';
}
ve<int> c;
map<pll, bool> pred;
ve<int> pra, va, prb, vb;
ve<ve<int>> ida, idb;
int who_a(int x) {
    int i = upper_bound(all(pra), x) - pra.begin() - 1;
    return va[i];
}
int who_b(int x) {
    int i = upper_bound(all(prb), x) - prb.begin() - 1;
    return vb[i];
}
bool get(int x, int y, int valx, int valy) {
    if (pred.find({x, y}) != pred.end())
        return pred[{x, y}];
    for (auto &t : c) {
        bool fa = (t != valx || (t == valx && binary_search(all(pra), x + 1))), fb = (t != valy || (t == valy && binary_search(all(prb), y + 1)));
        if (fa && fb) {
            auto it = upper_bound(all(ida[t]), x);
            if (it == ida[t].end())
                continue;
            int nxt_x = *it;
            it = upper_bound(all(idb[t]), y);
            if (it == idb[t].end())
                continue;
            int nxt_y = *it;
            if (get(nxt_x, nxt_y, t, t))
                return pred[{x, y}] = true;
        }
        else if (fb) {
            int nxt_x = x + 1;
            auto it = upper_bound(all(idb[t]), y);
            if (it == idb[t].end())
                continue;
            int nxt_y = *it;
            if (get(nxt_x, nxt_y, t, t))
                return pred[{x, y}] = true;
        }
        else if (fa) {
            int nxt_y = y + 1;
            auto it = upper_bound(all(ida[t]), x);
            if (it == ida[t].end())
                continue;
            int nxt_x = *it;
            if (get(nxt_x, nxt_y, t, t))
                return pred[{x, y}] = true;
        }
    }
    if (valx == valy && !binary_search(all(pra), x + 1) && !binary_search(all(prb), y + 1)) {
        int m1 = *upper_bound(all(pra), x), m2 = *upper_bound(all(prb), y);
        if (min(m1-x, m2-y) & 1)
            return pred[{x, y}] = true;
    }
    return pred[{x, y}] = false;
}
int32_t main() {
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    c.resize(k);
    iota(all(c), 1);
    shuffle(all(c), rnd);
    pra.resize(n+1);
    prb.resize(m+1);
    va.resize(n);
    vb.resize(m);
    ida.resize(k + 1);
    idb.resize(k + 1);
    for (int i = 0; i < n; ++i) {
        int l, a;
        cin >> l >> a;
        pra[i+1] = pra[i] + l;
        va[i] = a;
        ida[a].pb(pra[i]);
    }
    for (int i = 0; i < m; ++i) {
        int l, a;
        cin >> l >> a;
        prb[i+1] = prb[i] + l;
        vb[i] = a;
        idb[a].pb(prb[i]);
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        if (get(x, y, who_a(x), who_b(y)))
            cout << "Yes\n";
        else
            cout << "No\n";
    }
}
