Polycarpus has a chessboard of size n × m, where k rooks are placed. Polycarpus hasn't yet invented the rules of the game he will play. However, he has already allocated q rectangular areas of special strategic importance on the board, they must be protected well. According to Polycarpus, a rectangular area of ​​the board is well protected if all its vacant squares can be beaten by the rooks that stand on this area. The rooks on the rest of the board do not affect the area's defense. The position of the rooks is fixed and cannot be changed. We remind you that the the rook beats the squares located on the same vertical or horizontal line with it, if there are no other pieces between the square and the rook. Help Polycarpus determine whether all strategically important areas are protected.

Input

The first line contains four integers n, m, k and q (1 ≤ n, m ≤ 100 000, 1 ≤ k, q ≤ 200 000) — the sizes of the board, the number of rooks and the number of strategically important sites. We will consider that the cells of the board are numbered by integers from 1 to n horizontally and from 1 to m vertically. Next k lines contain pairs of integers "x y", describing the positions of the rooks (1 ≤ x ≤ n, 1 ≤ y ≤ m). It is guaranteed that all the rooks are in distinct squares. Next q lines describe the strategically important areas as groups of four integers "x1 y1 x2 y2" (1 ≤ x1 ≤ x2 ≤ n, 1 ≤ y1 ≤ y2 ≤ m). The corresponding rectangle area consists of cells (x, y), for which x1 ≤ x ≤ x2, y1 ≤ y ≤ y2. Strategically important areas can intersect of coincide.

Output

Print q lines. For each strategically important site print "YES" if it is well defended and "NO" otherwise.

Examples

Input

4 3 3 3
1 1
3 2
2 3
2 3 2 3
2 1 3 3
1 2 2 3


Output

YES
YES
NO

Note

Picture to the sample: <image> For the last area the answer is "NO", because cell (1, 2) cannot be hit by a rook.
#include <bits/stdc++.h>
using namespace std;
int n, m, K, Q, pv[101000], IT[131072 + 131072 + 1];
vector<int> E[101000];
bool chk[201000];
struct point {
  int x, y;
  bool operator<(const point &p) const { return y < p.y; }
} w[201000];
struct Query {
  int x1, x2, y1, y2, num;
  bool operator<(const Query &p) const { return y1 < p.y1; }
} P[201000];
void Push(int x, int y) {
  x += 131072;
  IT[x] = y;
  while (x != 1) {
    x >>= 1;
    IT[x] = max(IT[x * 2], IT[x * 2 + 1]);
  }
}
int Max(int b, int e) {
  b += 131072, e += 131072;
  int r = 0;
  while (b <= e) {
    r = max(r, IT[b]);
    r = max(r, IT[e]);
    b = (b + 1) >> 1, e = (e - 1) >> 1;
  }
  return r;
}
void Do() {
  int i, pv2 = 1;
  for (i = 1; i <= 100000; i++) {
    E[i].clear();
    pv[i] = 0;
    Push(i, 101000);
  }
  sort(w + 1, w + K + 1);
  sort(P + 1, P + Q + 1);
  for (i = 1; i <= K; i++) {
    if (!E[w[i].x].size()) {
      Push(w[i].x, w[i].y);
    }
    E[w[i].x].push_back(w[i].y);
  }
  for (i = 1; i <= Q; i++) {
    while (pv2 <= K && w[pv2].y < P[i].y1) {
      pv[w[pv2].x]++;
      if (pv[w[pv2].x] == E[w[pv2].x].size())
        Push(w[pv2].x, 101000);
      else
        Push(w[pv2].x, E[w[pv2].x][pv[w[pv2].x]]);
      pv2++;
    }
    if (Max(P[i].x1, P[i].x2) <= P[i].y2) chk[P[i].num] = true;
  }
}
int main() {
  int i;
  scanf("%d%d%d%d", &n, &m, &K, &Q);
  for (i = 1; i <= K; i++) {
    scanf("%d%d", &w[i].x, &w[i].y);
  }
  for (i = 1; i <= Q; i++) {
    scanf("%d%d%d%d", &P[i].x1, &P[i].y1, &P[i].x2, &P[i].y2);
    P[i].num = i;
  }
  Do();
  for (i = 1; i <= K; i++) swap(w[i].x, w[i].y);
  for (i = 1; i <= Q; i++) {
    swap(P[i].x1, P[i].y1);
    swap(P[i].x2, P[i].y2);
  }
  Do();
  for (i = 1; i <= Q; i++) {
    if (chk[i])
      printf("YES\n");
    else
      printf("NO\n");
  }
}
