#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve() {
    int N, sn, M, sm, k, q;
    cin >> N >> sn >> M >> sm >> k >> q;
    vector<pair<int, int>> segN(sn), segM(sm);
    vector<int> a(sn), lena(sn), b(sm), lenb(sm);
    for (int i = 0, head = 0; i < segN.size(); ++i) {
        cin >> segN[i].first >> segN[i].second;
        --segN[i].second;
        a[i] = segN[i].second;
        lena[i] = segN[i].first;
    }
    for (int i = 0, head = 0; i < segM.size(); ++i) {
        cin >> segM[i].first >> segM[i].second;
        --segM[i].second;
        b[i] = segM[i].second;
        lenb[i] = segM[i].first;
    }

    vector dp(sn, vector<int>(sm, -1));
    vector anyLose(sn, vector<int>(sm, 0));

    auto query = [&](int i, int j, int prefi, int prefj) -> bool {
        vector<array<int, 3>> A, B;
        int dista = 0, distb = 0;
        for (int ik = i, dist = 0; ik < sn; ++ik) {
            if (a[ik] == a[i]) {
                A.push_back({dist, lena[ik] - (ik == i ? prefi : 0), ik});
                dist += lena[ik] - (ik == i ? prefi : 0);
                dista = dist;
            }
        }
        for (int jk = j, dist = 0; jk < sm; ++jk) {
            if (b[jk] == b[j]) {
                B.push_back({dist, lenb[jk] - (jk == j ? prefj : 0), jk});
                dist += lenb[jk] - (jk == j ? prefj : 0);
                distb = dist;
            }
        }
        int ik = 0, jk = 0, dist = 0;
        int found = false;
        while (true) {
            if (ik + 1 < A.size() && (jk + 1 >= B.size() || A[ik + 1][0] < B[jk + 1][0])) {
                ik += 1;
                dist = A[ik][0];
            } else {
                jk += 1;
                if (jk >= B.size()) {
                    break;
                }
                dist = B[jk][0];
            }
            while (ik == -1 ||  ik < A.size() && A[ik][0] + A[ik][1] <= dist) {
                ik += 1;
            }
            while (jk == -1 || jk < B.size() && B[jk][0] + B[jk][1] <= dist) {
                jk += 1;
            }
            if (ik >= A.size() || jk >= B.size()) {
                break;
            }
            int idi = A[ik][2];
            int idj = B[jk][2];
            if (anyLose[idi][idj]) {
                return (dist % 2 == 1 ? false : true);
                found = true;
                break;
            }
        }
        dist = min(dista, distb);
        return (dist % 2 == 1 ? false : true);
    };

    vector<int> last_a(k, -1);
    for (int i = sn - 1; i >= 0; --i) {
        vector<int> val(k, -1);
        int cnt[2]{};
        set<int> ff;
        for (int j = sm - 1; j >= 0; --j) {
            if (a[i] == b[j]) {
                if (cnt[0] > 1 || cnt[0] == 1 && *ff.begin() != a[i]) {
                    dp[i][j] = true;
                    anyLose[i][j] = true;
                } else {
                    dp[i][j] = query(i, j, 0, 0);
                }
            }
            if (last_a[b[j]] != -1) {
                int x = b[j];
                if (val[x] != -1) {
                    cnt[bool(val[x])] -= 1;
                    if (val[x] == 0) {
                        ff.erase(x);
                    }
                }
                cnt[val[x] = bool(dp[last_a[x]][j])] += 1;
                if (val[x] == 0) {
                    ff.insert(x);
                }
            }
        }
        last_a[segN[i].second] = i;
    }
    /*
     * dp[i][j] = false => can't win
     * dp[i][j] = x + 1 => the only winning move
     * dp[i][j] = k + 2 => several winning moves
     */
//    vector<int> last_a(k, -1);
//    for (int i = N - 1; i >= 0; --i) {
//        vector<int> val(k, -1);
//        int cnt[2]{};
//        set<int> ff;
//        for (int j = M - 1; j >= 0; --j) {
//            if (a[i] == b[j]) {
//                if (cnt[0]) {
//                    dp[i][j] = cnt[0] > 1 ? k + 2 : *ff.begin() + 1;
//                } else {
//                    dp[i][j] = false;
//                }
//            }
//            if (last_a[b[j]] != -1) {
//                int x = b[j];
//                if (val[x] != -1) {
//                    cnt[bool(val[x])] -= 1;
//                    if (val[x] == 0) {
//                        ff.erase(x);
//                    }
//                }
//                cnt[val[x] = bool(dp[last_a[x]][j])] += 1;
//                if (val[x] == 0) {
//                    ff.insert(x);
//                }
//            }
//        }
//        last_a[a[i]] = i;
//    }

    auto qry = [&](int prefi, int prefj) {
        int i = 0, j = 0;
        while (prefi >= lena[i]) {
            prefi -= lena[i];
            i += 1;
        }
        while (prefj >= lenb[j]) {
            prefj -= lenb[j];
            j += 1;
        }
        if (a[i] != b[j]) {
            return false;
        }
        if (anyLose[i][j]) {
            return true;
        }
//        prefi += 1, prefj += 1;
//        while (prefi >= lena[i]) {
//            prefi -= lena[i];
//            i += 1;
//        }
//        while (prefj >= lenb[j]) {
//            prefj -= lenb[j];
//            j += 1;
//        }
        if (!query(i, j, prefi, prefj)) {
            return true;
        } else {
            return false;
        }
    };

//    cout << "dp:\n";
//    for (int i = 0; i < sn; ++i) {
//        for (int j = 0; j < sm; ++j) {
//            cout << dp[i][j]<< " ";
//        }
//        cout << endl;
//    }
//    cout << "anyLose:\n";
//    for (int i = 0; i < sn; ++i) {
//        for (int j = 0; j < sm; ++j) {
//            cout << anyLose[i][j];
//        }
//        cout << endl;
//    }

    if (1) {
        while (q--) {
            int prefi, prefj;
            cin >> prefi >> prefj;
            if (qry(prefi, prefj)) {
                cout << "Yes\n";
            } else {
                cout << "No\n";
            }
        }
    } else {
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < M; ++j) {
                cout << qry(i, j);
            }
            cout << endl;
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int test = 1;
//    cin >> test;
    while (test--) {
        solve();
    }

    return 0;
}