// #pragma GCC optimize("O3,unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

// #pragma GCC target("sse4.2,bmi,bmi2,popcnt,lzcnt,avx2")

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef __int128_t d128;
typedef int dgt;
typedef pair<dgt, dgt> pdd;
const dgt MOD = 1e9 + 7;
const dgt INF = 1e9 + 1;
const ll INFLL = 1e18 + 1;
const ld EPS = 1e-9;

// typedef tree<dgt, null_type, less<dgt>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define all(x) x.begin(), x.end()

template<typename T1, typename T2>
istream& operator >> (istream&, pair<T1, T2>&);

template<typename T1, typename T2>
ostream& operator << (ostream&, const pair<T1, T2>&);

template<typename T>
istream& operator >> (istream& is, vector<T>& arr) {
    for (T& el: arr)
        is >> el;
    return is;
}

template<typename T>
ostream& operator << (ostream& os, const vector<T>& arr) {
    for (const T& el: arr)
        os << el << ' ';
    return os;
}

template<typename T1, typename T2>
istream& operator >> (istream& is, pair<T1, T2>& pr) {
    return is >> pr.first >> pr.second;
}

template<typename T1, typename T2>
ostream& operator << (ostream& os, const pair<T1, T2>& pr) {
    return os << pr.first << ' ' << pr.second;
}

struct trip {
    dgt first, second, third;
};

void solve() {
    dgt N, n, M, m, k, q;
    cin >> N >> n >> M >> m >> k >> q;
    vector<dgt> a, b;
    vector<dgt> pa(n + 1, 0), pb(m + 1, 0);
    vector<trip> ia(n, {-1, -1, -1}), ib(m, {-1, -1, -1});
    for (dgt i = 0; i < n; ++i) {
        dgt l, v;
        cin >> l >> v;
        ia[i].first = a.size();
        a.push_back(v);
        if (l > 1) {
            ia[i].second = a.size();
            a.push_back(v);
            if (l % 2 == 1) {
                ia[i].third = a.size();
                a.push_back(v);
            }
        }
        pa[i + 1] = pa[i] + l;
    }
    for (dgt i = 0; i < m; ++i) {
        dgt l, v;
        cin >> l >> v;
        ib[i].first = b.size();
        b.push_back(v);
        if (l > 1) {
            ib[i].second = b.size();
            b.push_back(v);
            if (l % 2 == 1) {
                ib[i].third = b.size();
                b.push_back(v);
            }
        }
        pb[i + 1] = pb[i] + l;
    }
    dgt A = a.size(), B = b.size();
    vector<vector<bool>> ans(A + 1, vector<bool>(B + 1, true));
    ans[A].assign(B + 1, false);
    for (dgt i = 0; i <= A; ++i)
        ans[i][B] = false;
    vector<dgt> pos_y(k + 1, -1);
    for (dgt y = B - 1; y >= 0; --y) {
        pos_y[b[y]] = y;
        vector<dgt> pos_x(k + 1, -1);
        set<dgt> zer;
        dgt cnt = 0;
        for (dgt x = A - 1; x >= 0; --x) {
            pos_x[a[x]] = x;
            zer.erase(a[x]);
            if (pos_y[a[x]] != -1 && !ans[pos_x[a[x]] + 1][pos_y[a[x]] + 1])
                zer.insert(a[x]);
            ans[x][y] = (zer.size() > 0);
        }
    }
    for (; q > 0; --q) {
        dgt x, y;
        cin >> x >> y;
        dgt i = upper_bound(all(pa), x) - pa.begin();
        dgt j = upper_bound(all(pb), y) - pb.begin();
        --i, --j;
        dgt ind_x = x - pa[i], ind_y = y - pb[j];
        // 
        if ((pa[i + 1] - pa[i] % 2) == 1) {
            if (ind_x == 0)
                ind_x = ia[i].first;
            else if (ind_x % 2 == 0)
                ind_x = ia[i].third;
            else
                ind_x = ia[i].second;
        } else {
            if (ind_x == 0)
                ind_x = ia[i].first;
            else
                ind_x = ia[i].second;
        }
        // 
        if ((pb[j + 1] - pb[j] % 2) == 1) {
            if (ind_y == 0)
                ind_y = ib[j].first;
            else if (ind_y % 2 == 0)
                ind_y = ib[j].third;
            else
                ind_y = ib[j].second;
        } else {
            if (ind_y == 0)
                ind_y = ib[j].first;
            else
                ind_y = ib[j].second;
        }
        // 
        if (ans[ind_x][ind_y])
            cout << "Yes\n";
        else
            cout << "No\n";
    }
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int reps = 1;
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    cin >> reps;
#endif

    for (int i = 0; i < reps; ++i) {
#ifdef LOCAL
        cout << "Test case #" << i << " ===========================\n";
#endif
        solve();
#ifdef LOCAL
        cout << "End test ===============================\n";
#endif
    }

    return 0;
}

// g++ -std=c++23 -Wall -Wextra -Wshadow -O2 -DLOCAL -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -fsanitize=address,undefined
