#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <iterator>
#include <list>
#include <set>
#include <queue>
#include <numeric>
#include <cstdlib>
#include <ctime>
#include <limits>
#include <valarray>
#include <cassert>

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

using namespace std;

typedef long long lli;
typedef int li;

template <class T>
bool Maximize (T &v, T nv) { if (nv > v) return v = nv, 1; return 0; }

template <class T>
bool Minimize (T &v, T nv) { if (nv < v) return v = nv, 1; return 0; }

template <class T>
T Mod (T &v, T mod) { return v = (v % mod + mod) % mod; }

const lli INFLL = numeric_limits<lli>::max();
const li INF = numeric_limits<li>::max(), K = 2e5 + 1, Q = 2e5 + 1;
const li di[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};

li nextInt ()
{
	li c;
	while (!isdigit(c = getchar()));
	li x = c - '0';
	while (isdigit(c = getchar()))
		x = 10 * x + c - '0';
	return x;
}

char mem[1 << 27], *memptr = mem;
void * operator new (size_t sz)
{
	memptr += sz;
	return memptr - sz;
}

class Treap
{
	struct Node
	{
		li pr, sz, v;
		Node *l, *r;

		Node (li v) : pr(rand() << 15 | rand()), sz(1), v(v), l(0), r(0) {}

		void Update ()
		{
			sz = 1 + SizeOf(l) + SizeOf(r);
		}

		static li SizeOf (Node *v)
		{
			return v ? v->sz : 0;
		}

		static void Update (Node *v)
		{
			if (v)
				v->Update();
		}
	};

	Node *root;

	void split (Node *v, li x, Node *&l, Node *&r)
	{
		if (!v)
			return void(r = l = 0);

		if (v->v <= x)
		{
			l = v;
			split(v->r, x, l->r, r);
			Node::Update(l);
		}
		else
		{
			r = v;
			split(v->l, x, l, r->l);
			Node::Update(r);
		}
	}

	void merge (Node *l, Node *r, Node *&v)
	{
		if (!l || !r)
			return void(v = l ? l : r);

		if (l->pr > r->pr)
		{
			v = l;
			merge(l->r, r, v->r);
		}
		else
		{
			v = r;
			merge(l, r->l, v->l);
		}
		Node::Update(v);
	}

	void erase (Node *&v, li key)
	{
		if (v->v == key)
			merge(v->l, v->r, v);
		else
			erase(key < v->v ? v->l : v->r, key);
		Node::Update(v);
	}

public:
	Treap () : root(0) {}

	void Insert (li v)
	{
		Node *l, *r;
		split(root, v, l, r);
		merge(l, new Node(v), l);
		merge(l, r, root);
	}

	li Greater (li v)
	{
		Node *l, *r;
		split(root, v, l, r);
		li res = Node::SizeOf(r);
		merge(l, r, root);
		return res;
	}

	void Erase (li v)
	{
		erase(root, v);
	}

	li GetRootValue ()
	{
		return root->v;
	}
};

class SegmentTree
{
	struct Node
	{
		li l, r;
		Treap *s;
		Node *left, *right;

		Node (li i) : l(i), r(i), s(new Treap()), left(0), right(0)
		{
			s->Insert(0);
		}

		Node (li l, li r, Node *left, Node *right) : l(l), r(r), s(new Treap()), left(left), right(right)
		{
			for (li i = r - l + 1; i; -- i)
				s->Insert(0);
		}

		bool IsLeaf ()
		{
			return l == r;
		}
	};

	Node *root;

	Node* build (li l, li r)
	{
		return l == r ? new Node(l) : new Node(l, r, build(l, (l + r) / 2), build((l + r) / 2 + 1, r));
	}

	li set (Node *v, li i, li d)
	{
		if (v->IsLeaf())
		{
			li val = v->s->GetRootValue();
			v->s->Erase(val);
			v->s->Insert(d);
			return val;
		}

		li res = set(i <= (v->l + v->r) / 2 ? v->left : v->right, i, d);
		v->s->Erase(res);
		v->s->Insert(d);
		return res;
	}

	li greater (Node *v, li l, li r, li d)
	{
		if (v->l > r || v->r < l)
			return 0;
		if (v->l >= l && v->r <= r)
			return v->s->Greater(d);
		return greater(v->left, l, r, d) + greater(v->right, l, r, d);
	}

public:
	SegmentTree (li l, li r)
	{
		root = build(l, r);
	}

	void Set (li i, li d)
	{
		set(root, i, d);
	}

	li Greater (li l, li r, li d)
	{
		return greater(root, l, r, d);
	}
};

struct Rook
{
	li x, y;

	bool operator < (const Rook &r) const
	{
		return x < r.x;
	}
};

struct Rect
{
	li x1, x2, y1, y2, i;

	bool operator < (const Rect &r) const
	{
		return x2 < r.x2;
	}
};

Rook rs[K];
Rect rects[Q];
bool ok[Q];

void solve ()
{
	srand(time(0));

	li w = nextInt(), h = nextInt(), k = nextInt(), q = nextInt();
	//scanf("%d %d %d %d", &w, &h, &k, &q);

	for (li i = 0; i < k; ++ i)
	{
		Rook &r = rs[i];
		//scanf("%d %d", &r.x, &r.y);
		r.x = nextInt(), r.y = nextInt();
	}

	for (li i = 0; i < q; ++ i)
	{
		Rect &r = rects[i];
		r.i = i;
		//scanf("%d %d %d %d", &r.x1, &r.y1, &r.x2, &r.y2);
		r.x1 = nextInt(), r.y1 = nextInt(), r.x2 = nextInt(), r.y2 = nextInt();
	}

	for (li jesuisstdpide = 0; jesuisstdpide < 2; ++ jesuisstdpide)
	{
		sort(rs, rs + k);
		sort(rects, rects + q);
		SegmentTree *t = new SegmentTree(1, h);
		for (li i = 0, j = 0; i < q; ++ i)
		{
			Rect &r = rects[i];
			for (; j < k && rs[j].x <= r.x2; ++ j)
			{
				t->Set(rs[j].y, rs[j].x);
				swap(rs[j].x, rs[j].y);
			}

			ok[r.i] |= t->Greater(r.y1, r.y2, r.x1 - 1) == r.y2 - r.y1 + 1;
			swap(r.x1, r.y1);
			swap(r.x2, r.y2);
		}
		swap(h, w);
	}

	for (li i = 0; i < q; ++ i)
	{
		puts(ok[i] ? "YES" : "NO");
	}
}

void init ()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
}

int main()
{
	init();
	solve();
	return 0;
}


/*
You never see what's inside of me
That's why you won't face the truth
Fighting forever a fight you can't win
Touching my soul ain't like touching my skin

Open your mind, don't you ever slow down
Spread out your wings and reach out for the crown

It's not made out of gold, 'cause it's the crown of thorns
Not made for human soul
Ashes to ashes that's where it ends
Nobody could get more far beyond

Flying high I can see the years pass by
And I won't return to the same old places that I've been before
Is it still the same old face I can see no more?
Oh, see no more

Out in the gutter like a fox on the run
Everyone's after your dreams
So did you learn your lesson well?
If you did not they will send you to hell

Inside your heart you will never forget
How things went wrong and made you feel so sad
But the path is too small no one's gonna hear your call
As you wander by yourself

Ashes to ashes that's where it ends
Nobody could get more far beyond

Flying high I can see the years pass by
And I won't return to the same old places that I've been before
Is it still the same old face I can see no more?
Oh, see no more

Flying high I can see the years pass by
And I won't return to the same old places that I've been before
Is it still the same old face I can see no more?
Oh, see no more

Flying high I can see the years pass by
And I won't return to the same old places that I've been before
Is it still the same old face I can see no more?
Oh, see no more
Oh, see no more
*/

//#pragma comment(linker, "/STACK:16777216")
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <ctime>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash

#define eps 1e-9
//#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 256
#define right adsgasgadsg
#define free adsgasdg
#define MAGIC 47
#define count adsgasdgasdg

using namespace std;

long n,m,k,q,a,b;
vector<long> x[1<<20],y[1<<20];
long queries;
long x1[1<<20],y1[1<<20],x2[1<<20],y2[1<<20];
long t[1<<20];
vector<long> v1[1<<20],v2[1<<20];
long covered[1<<20];

void build(long v,long l,long r)
{
 if (l==r)
  {
   t[v]=-100;
   return ;
  }
  long m=l+r;
  m/=2;
  build(v*2,l,m);
  build(v*2+1,m+1,r);
  t[v]=-100;
}

long get(long v,long tl,long tr,long l,long r)
{
 if (l>r) return 1000000;
 if (l==tl&&r==tr) return t[v];
 long tm=tl+tr;
 tm/=2;
 long res1=get(v*2,tl,tm,l,min(r,tm));
 long res2=get(v*2+1,tm+1,tr,max(l,tm+1),r);
 return min(res1,res2);
}

void update(long v,long tl,long tr,long ps,long val)
{
 if (tl==tr)
 {
  t[v]=val;
  return;
 }
 long tm=tl+tr;
 tm/=2;
 if (ps<=tm)
  update(v*2,tl,tm,ps,val);
  else update(v*2+1,tm+1,tr,ps,val);
 t[v]=min(t[v*2],t[v*2+1]);
}

int main(){
//freopen("k.in","r",stdin);
//freopen("k.out","w",stdout);
//freopen("C:/input.txt","r",stdin);
//freopen("C:/output.txt","w",stdout);
ios_base::sync_with_stdio(0);
//cin.tie(0);

cin>>n>>m>>k>>q;
for (int i=1;i<=k;i++)
{
 cin>>a>>b;
 x[a].push_back(b);
 y[b].push_back(a);
}

queries=q;

for (int i=1;i<=queries;i++)
{
 cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
 v1[x2[i]].push_back(i);
 v2[y2[i]].push_back(i);
}

build(1,1,200000);

for (int i=1;i<=n;i++)
{
 for (int j=0;j<x[i].size();j++)
 {
  long id=x[i][j];
  update(1,1,200000,id,i);
 }
 for (int j=0;j<v1[i].size();j++)
 {
  long id=v1[i][j];
  long L,R;
  L=y1[id];
  R=y2[id];
  long res=get(1,1,200000,L,R);
  if (res>=x1[id])
   covered[id]=1;
 }
}

// Copy paste

build(1,1,200000);

for (int i=1;i<=m;i++)
{
 for (int j=0;j<y[i].size();j++)
 {
  long id=y[i][j];
  update(1,1,200000,id,i);
 }
 for (int j=0;j<v2[i].size();j++)
 {
  long id=v2[i][j];
  long L,R;
  L=x1[id];
  R=x2[id];
  long res=get(1,1,200000,L,R);
  if (res>=y1[id])
   covered[id]=1;
 }
}

for (int i=1;i<=queries;i++)
if (covered[i])
puts("YES");
else puts("NO");

cin.get();cin.get();
return 0;}


/*
*/

//#pragma comment(linker, "/STACK:16777216")
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <ctime>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash

#define eps 1e-9
//#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 256
#define right adsgasgadsg
#define free adsgasdg
#define MAGIC 47
#define count adsgasdgasdg

using namespace std;

long n,m,k,q,a,b;
vector<long> x[1<<20],y[1<<20];
long queries;
long x1[1<<20],y1[1<<20],x2[1<<20],y2[1<<20];
long t[1<<20];
vector<long> v1[1<<20],v2[1<<20];
long covered[1<<20];

void build(long v,long l,long r)
{
 if (l==r)
  {
   t[v]=-100;
   return ;
  }
  long m=l+r;
  m/=2;
  build(v*2,l,m);
  build(v*2+1,m+1,r);
  t[v]=-100;
}

long get(long v,long tl,long tr,long l,long r)
{
 if (l>r) return 1000000;
 if (l==tl&&r==tr) return t[v];
 long tm=tl+tr;
 tm/=2;
 long res1=get(v*2,tl,tm,l,min(r,tm));
 long res2=get(v*2+1,tm+1,tr,max(l,tm+1),r);
 return min(res1,res2);
}

void update(long v,long tl,long tr,long ps,long val)
{
 if (tl==tr)
 {
  t[v]=val;
  return;
 }
 long tm=tl+tr;
 tm/=2;
 if (ps<=tm)
  update(v*2,tl,tm,ps,val);
  else update(v*2+1,tm+1,tr,ps,val);
 t[v]=min(t[v*2],t[v*2+1]);
}

int main(){
//freopen("k.in","r",stdin);
//freopen("k.out","w",stdout);
//freopen("C:/input.txt","r",stdin);
//freopen("C:/output.txt","w",stdout);
ios_base::sync_with_stdio(0);
//cin.tie(0);

cin>>n>>m>>k>>q;
for (int i=1;i<=k;i++)
{
 cin>>a>>b;
 x[a].push_back(b);
 y[b].push_back(a);
}

queries=q;

for (int i=1;i<=queries;i++)
{
 cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
 v1[x2[i]].push_back(i);
 v2[y2[i]].push_back(i);
}

build(1,1,200000);

for (int i=1;i<=n;i++)
{
 for (int j=0;j<x[i].size();j++)
 {
  long id=x[i][j];
  update(1,1,200000,id,i);
 }
 for (int j=0;j<v1[i].size();j++)
 {
  long id=v1[i][j];
  long L,R;
  L=y1[id];
  R=y2[id];
  long res=get(1,1,200000,L,R);
  if (res>=x1[id])
   covered[id]=1;
 }
}

// Copy paste

build(1,1,200000);

for (int i=1;i<=m;i++)
{
 for (int j=0;j<y[i].size();j++)
 {
  long id=y[i][j];
  update(1,1,200000,id,i);
 }
 for (int j=0;j<v2[i].size();j++)
 {
  long id=v2[i][j];
  long L,R;
  L=x1[id];
  R=x2[id];
  long res=get(1,1,200000,L,R);
  if (res>=y1[id])
   covered[id]=1;
 }
}

for (int i=1;i<=queries;i++)
if (covered[i])
puts("YES");
else puts("NO");

cin.get();cin.get();
return 0;}


#include <cstdio>
#include <algorithm>
#include <vector>
#define N 200005
#define L (d << 1)
#define R (L | 1)
#define M (l + r >> 1)
#define fi(a, b, c) for(int a = (b); a < (c); a++)
#define FI(a, b, c) for(int a = (b); a <= (c); a++)
using namespace std;

int n, m, k, q, x[N], y[N], ord[N], lx[N], ly[N], hx[N], hy[N], t[1 << 18], pt[N];
vector<int> upd[N], que[N], row[N];
bool ans[N];

void init(int d, int l, int r){
	if(l == r){
		t[d] = row[l][pt[l]];
		return;
	}
	init(L, l, M);
	init(R, M + 1, r);
	t[d] = max(t[L], t[R]);
}

void update(int d, int l, int r, int p){
	if(l == r){
		t[d] = row[l][pt[l]];
		return;
	}
	if(p > M) update(R, M + 1, r, p);
	else update(L, l, M, p);
	t[d] = max(t[L], t[R]);
}

int query(int d, int l, int r, int a, int b){
	if(a <= l && r <= b) return t[d];
	int ret = 0;
	if(a <= r && b > M) ret = max(ret, query(R, M + 1, r, a, b));
	if(a <= M && b >= l) ret = max(ret, query(L, l, M, a, b));
	return ret;
}

int main(){
	scanf("%d %d %d %d", &n, &m, &k, &q);
	fi(i, 0, k){
		scanf("%d %d", &x[i], &y[i]);
		upd[x[i]].push_back(y[i]);
		row[y[i]].push_back(x[i]);
	}

	FI(i, 1, m){
		row[i].push_back(n + 1);
		sort(row[i].begin(), row[i].end());
		pt[i] = 0;
	}

	fi(i, 0, q){
		scanf("%d %d %d %d", &lx[i], &ly[i], &hx[i], &hy[i]);
		que[lx[i]].push_back(i);
	}

	init(1, 1, m);

	FI(i, 1, n){
		fi(j, 0, que[i].size()){
			int k = que[i][j];
			if(query(1, 1, m, ly[k], hy[k]) <= hx[k]) ans[k] = 1;
		}
		fi(j, 0, upd[i].size()){
			int k = upd[i][j];
			pt[k]++;
			update(1, 1, m, k);
		}
	}

	FI(i, 1, n){
		upd[i].clear();
		que[i].clear();
	}
	FI(i, 1, m) row[i].clear();

	fi(i, 0, k){
		upd[y[i]].push_back(x[i]);
		row[x[i]].push_back(y[i]);
	}

	FI(i, 1, n){
		row[i].push_back(m + 1);
		sort(row[i].begin(), row[i].end());
		pt[i] = 0;
	}

	fi(i, 0, q) que[ly[i]].push_back(i);

	init(1, 1, n);

	FI(i, 1, m){
		fi(j, 0, que[i].size()){
			int k = que[i][j];
			if(query(1, 1, n, lx[k], hx[k]) <= hy[k]) ans[k] = 1;
		}
		fi(j, 0, upd[i].size()){
			int k = upd[i][j];
			pt[k]++;
			update(1, 1, n, k);
		}
	}

	fi(i, 0, q) puts(ans[i] ? "YES" : "NO");

	scanf("\n");
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstring>
#include <deque>
#include <time.h>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#define mp make_pair
#define pb push_back
#define PI 3.14159265358979323846
#define MOD 1000000007
#define x1 flkdgl
#define x2 fdgdfgh
#define y1 lfdkgl
#define y2 lhkgflhkf
typedef long long ll;
using namespace std;
ll x1,x2,y1,y2,x,y,z,w,l,r,i,j,n,t[1005000],k,k1,k2,d,m,q,dr,a[200500],ans[200500];
string s;
vector <ll> ladv[100500],ladh[100500];
vector <pair<pair<ll,ll>,pair<ll,ll> > > vv[100500],hh[100500];
void build(ll v, ll tl, ll tr)
{
 if (tl == tr)
 {
    t[v] = a[tl];
    return;
 }
 ll tm = (tl+tr)/2;
 build(v*2,tl,tm);
 build(v*2+1,tm+1,tr);
 t[v] = min(t[v*2],t[v*2+1]);
}

void update(ll v, ll tl, ll tr, ll pos, ll val)
{
 if (tl == tr)
 {
  t[v] = val;
  return;
 }
 ll tm = (tl+tr)/2;
 if (pos <= tm)
    update(v*2,tl,tm,pos,val);
 else
     update(v*2+1,tm+1,tr,pos,val);
 t[v] = min(t[v*2],t[v*2+1]);
}
ll sum(ll v, ll tl, ll tr, ll l, ll r)
{
 if (l > r)
    return (ll)1e+18;
 if (tl == l && tr == r)
    return t[v];
 ll tm = (tl+tr)/2;
 return min(sum(v*2,tl,tm,l,min(tm,r)),sum(v*2+1,tm+1,tr,max(l,tm+1),r));
}
int main()
{
    cin >> n >> m >> k >> q;
    for (i = 0; i < k; i++)
    {
        scanf("%I64d%I64d",&x,&y);
        ladh[x].push_back(y);
        ladv[y].push_back(x);
    }

    for (i = 0; i < q; i++)
    {
        scanf("%I64d%I64d%I64d%I64d",&x1,&y1,&x2,&y2);
        hh[x2].push_back(mp(mp(x1,i),mp(y1,y2)));
        vv[y2].push_back(mp(mp(y1,i),mp(x1,x2)));
    }
    for (i = 0; i <= n+m; i++)
        a[i] = 0;
    build(1,0,m+n);
    for (i = 1; i <= n; i++)
    {
        for (j = 0; j < ladh[i].size(); j++)
        {
            update(1,0,m+n,ladh[i][j],i);
        }
        for (j = 0; j < hh[i].size(); j++)
        {
            if (sum(1,0,m+n,hh[i][j].second.first,hh[i][j].second.second) >=
               hh[i][j].first.first)
               ans[hh[i][j].first.second] = 1;
        }
    }

    for (i = 0; i <= m+n; i++)
        a[i] = 0;
    build(1,0,m+n);

    for (i = 1; i <= m; i++)
    {
        for (j = 0; j < ladv[i].size(); j++)
        {
            update(1,0,m+n,ladv[i][j],i);
        }
        for (j = 0; j < vv[i].size(); j++)
        {
            if (sum(1,0,m+n,vv[i][j].second.first,vv[i][j].second.second) >=
               vv[i][j].first.first)
               ans[vv[i][j].first.second] = 1;

        }
    }

    for (i = 0; i < q; i++)
        if (ans[i])
           cout << "YES" << endl;
        else
            cout << "NO" << endl;
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstring>
#include <deque>
#include <time.h>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#define mp make_pair
#define pb push_back
#define PI 3.14159265358979323846
#define MOD 1000000007
#define x1 flkdgl
#define x2 fdgdfgh
#define y1 lfdkgl
#define y2 lhkgflhkf
typedef long long ll;
using namespace std;
ll x1,x2,y1,y2,x,y,z,w,l,r,i,j,n,t[1005000],k,k1,k2,d,m,q,dr,a[200500],ans[200500];
string s;
vector <ll> ladv[100500],ladh[100500];
vector <pair<pair<ll,ll>,pair<ll,ll> > > vv[100500],hh[100500];
void build(ll v, ll tl, ll tr)
{
 if (tl == tr)
 {
    t[v] = a[tl];
    return;
 }
 ll tm = (tl+tr)/2;
 build(v*2,tl,tm);
 build(v*2+1,tm+1,tr);
 t[v] = min(t[v*2],t[v*2+1]);
}

void update(ll v, ll tl, ll tr, ll pos, ll val)
{
 if (tl == tr)
 {
  t[v] = val;
  return;
 }
 ll tm = (tl+tr)/2;
 if (pos <= tm)
    update(v*2,tl,tm,pos,val);
 else
     update(v*2+1,tm+1,tr,pos,val);
 t[v] = min(t[v*2],t[v*2+1]);
}
ll sum(ll v, ll tl, ll tr, ll l, ll r)
{
 if (l > r)
    return (ll)1e+18;
 if (tl == l && tr == r)
    return t[v];
 ll tm = (tl+tr)/2;
 return min(sum(v*2,tl,tm,l,min(tm,r)),sum(v*2+1,tm+1,tr,max(l,tm+1),r));
}
int main()
{
    cin >> n >> m >> k >> q;
    for (i = 0; i < k; i++)
    {
        cin >> x >> y;
        ladh[x].push_back(y);
        ladv[y].push_back(x);
    }

    for (i = 0; i < q; i++)
    {
        cin >> x1 >> y1 >> x2 >> y2;
        hh[x2].push_back(mp(mp(x1,i),mp(y1,y2)));
        vv[y2].push_back(mp(mp(y1,i),mp(x1,x2)));
    }
    for (i = 0; i <= n+m; i++)
        a[i] = 0;
    build(1,0,m+n);
    for (i = 1; i <= n; i++)
    {
        for (j = 0; j < ladh[i].size(); j++)
        {
            update(1,0,m+n,ladh[i][j],i);
        }
        for (j = 0; j < hh[i].size(); j++)
        {
            if (sum(1,0,m+n,hh[i][j].second.first,hh[i][j].second.second) >=
               hh[i][j].first.first)
               ans[hh[i][j].first.second] = 1;
        }
    }

    for (i = 0; i <= m+n; i++)
        a[i] = 0;
    build(1,0,m+n);

    for (i = 1; i <= m; i++)
    {
        for (j = 0; j < ladv[i].size(); j++)
        {
            update(1,0,m+n,ladv[i][j],i);
        }
        for (j = 0; j < vv[i].size(); j++)
        {
            if (sum(1,0,m+n,vv[i][j].second.first,vv[i][j].second.second) >=
               vv[i][j].first.first)
               ans[vv[i][j].first.second] = 1;

        }
    }

    for (i = 0; i < q; i++)
        if (ans[i])
           cout << "YES" << endl;
        else
            cout << "NO" << endl;
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstring>
#include <deque>
#include <time.h>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#define mp make_pair
#define pb push_back
#define PI 3.14159265358979323846
#define MOD 1000000007
#define x1 flkdgl
#define x2 fdgdfgh
#define y1 lfdkgl
#define y2 lhkgflhkf
typedef long long ll;
using namespace std;
ll x1,x2,y1,y2,x,y,z,w,l,r,i,j,n,t[1005000],k,k1,k2,d,m,q,dr,a[200500],ans[200500];
string s;
vector <ll> ladv[100500],ladh[100500];
vector <pair<pair<ll,ll>,pair<ll,ll> > > vv[100500],hh[100500];
void build(ll v, ll tl, ll tr)
{
 if (tl == tr)
 {
    t[v] = a[tl];
    return;
 }
 ll tm = (tl+tr)/2;
 build(v*2,tl,tm);
 build(v*2+1,tm+1,tr);
 t[v] = min(t[v*2],t[v*2+1]);
}

void update(ll v, ll tl, ll tr, ll pos, ll val)
{
 if (tl == tr)
 {
  t[v] = val;
  return;
 }
 ll tm = (tl+tr)/2;
 if (pos <= tm)
    update(v*2,tl,tm,pos,val);
 else
     update(v*2+1,tm+1,tr,pos,val);
 t[v] = min(t[v*2],t[v*2+1]);
}
ll sum(ll v, ll tl, ll tr, ll l, ll r)
{
 if (l > r)
    return (ll)1e+18;
 if (tl == l && tr == r)
    return t[v];
 ll tm = (tl+tr)/2;
 return min(sum(v*2,tl,tm,l,min(tm,r)),sum(v*2+1,tm+1,tr,max(l,tm+1),r));
}
int main()
{
    cin >> n >> m >> k >> q;
    for (i = 0; i < k; i++)
    {
        cin >> x >> y;
        ladh[x].push_back(y);
        ladv[y].push_back(x);
    }

    for (i = 0; i < q; i++)
    {
        cin >> x1 >> y1 >> x2 >> y2;
        hh[x2].push_back(mp(mp(x1,i),mp(y1,y2)));
        vv[y2].push_back(mp(mp(y1,i),mp(x1,x2)));
    }
    for (i = 0; i <= n; i++)
        a[i] = 0;
    build(1,0,n);
    for (i = 1; i <= n; i++)
    {
        for (j = 0; j < ladh[i].size(); j++)
        {
            update(1,0,n,ladh[i][j],i);
        }
        for (j = 0; j < hh[i].size(); j++)
        {
            if (sum(1,0,n,hh[i][j].second.first,hh[i][j].second.second) >=
               hh[i][j].first.first)
               ans[hh[i][j].first.second] = 1;
        }
    }

    for (i = 0; i <= m; i++)
        a[i] = 0;
    build(1,0,m);

    for (i = 1; i <= m; i++)
    {
        for (j = 0; j < ladv[i].size(); j++)
        {
            update(1,0,m,ladv[i][j],i);
        }
        for (j = 0; j < vv[i].size(); j++)
        {
            if (sum(1,0,m,vv[i][j].second.first,vv[i][j].second.second) >=
               vv[i][j].first.first)
               ans[vv[i][j].first.second] = 1;

        }
    }

    for (i = 0; i < q; i++)
        if (ans[i])
           cout << "YES" << endl;
        else
            cout << "NO" << endl;
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>

using namespace std;

#define INF 1e+9
#define mp make_pair
#define pb push_back
#define fi first
#define fs first
#define se second
#define i64 long long
#define li long long
#define lint long long
#define pii pair<int, int>
#define vi vector<int>

#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define fore(i, b, e) for (int i = (int)b; i <= (int)e; i++)

struct Event
{
    int t, first, second;
    Event(int _t, int _first, int _second) : t(_t), first(_first), second(_second) {}
};

bool operator < (const Event & first, const Event & second)
{
    if (first.t != second.t)
        return first.t < second.t;
    return first.first == -1;
}

const int maxn = 2e5 + 5;
const int inf = 1e9;

int fails[maxn];
vi list[maxn];
int qx1[maxn];
int qy1[maxn];
int qx2[maxn];
int qy2[maxn];
pii rooks[maxn];
int n, k, Q, m;
int tree[maxn * 4];

void upd(int i, int tl, int tr, int pos, int val)
{
    if (tl + 1 == tr)
    {
        tree[i] = val;
        return;
    }
    int m = (tl + tr) / 2;
    if (pos < m)
        upd(i * 2, tl, m, pos, val);
    else upd(i * 2 + 1, m, tr, pos, val);
    tree[i] = max(tree[i * 2], tree[i * 2 + 1]);
}

int get(int i, int tl, int tr, int L, int R)
{
    if (L >= tr || tl >= R)
        return -inf;
    if (tl == L && tr == R)
        return tree[i];
    int m = (tl + tr) / 2;
    int g1 = get(i * 2, tl, m, L, min(m, R));
    int g2 = get(i * 2 + 1, m, tr, max(m, L), R);
    return max(g1, g2);
}

bool cmp(pii first, pii second)
{
    return first.se < second.se;
}

void solve()
{
    //printf("solve\n");
    vector <Event> events;
    forn(q, Q)
    {
       events.pb(Event(qy1[q], -1, q));
    }
    sort(rooks, rooks + k, cmp);
    fore(i, 1, n)
        list[i].clear();
    fore(i, 1, n)
    {
        list[i].pb(0);
    }
    forn(i, k)
    {
        list[rooks[i].fi].pb(rooks[i].se);
    }
    fore(i, 1, n)
        list[i].pb(m + 1);

    fore(i, 1, n)
    {
        forn(j, list[i].size() - 1)
        {
            events.pb(Event(list[i][j], i, list[i][j + 1]));
        }
    }
    sort(events.begin(), events.end());
    forn(iter, events.size())
    {
        Event e = events[iter];
    //    printf("e = (%d %d %d)\n", e.t, e.first, e.second);
        if (e.first == -1)
        {
            int g = get(1, 1, n + 1, qx1[e.second], qx2[e.second] + 1);
      //      printf("g = %d qy2 = %d\n", g, qy2[e.second]);
            if (g > qy2[e.second])
            {
                fails[e.second]++;
        //        printf("fails[%d]++\n", e.second);
            }
        }
        else
        {
            upd(1, 1, n + 1, e.first, e.second);
        }
    }
}

int main() {
#ifdef LOCAL
    freopen("inp", "r", stdin);
    //freopen("outp", "w", stdout);
#else
    // freopen(TASKNAME ".in", "r", stdin);
    // freopen(TASKNAME ".out", "w", stdout);
#endif
    scanf("%d%d%d%d", &n, &m, &k, &Q);
    forn(i, k)
    {
        scanf("%d%d", &rooks[i].fi, &rooks[i].se);
    }
    forn(q, Q)
    {
        scanf("%d%d%d%d", &qx1[q], &qy1[q], &qx2[q], &qy2[q]);
    }
    solve();
    swap(n, m);
    forn(i, k)
        swap(rooks[i].fi, rooks[i].se);
    forn(q, Q)
    {
        swap(qx1[q], qy1[q]);
        swap(qx2[q], qy2[q]);
    }
    solve();
    forn(q, Q)
        if (fails[q] == 2)
            printf("NO\n");
        else printf("YES\n");

}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>

using namespace std;

#define INF 1e+9
#define mp make_pair
#define pb push_back
#define fi first
#define fs first
#define se second
#define i64 long long
#define li long long
#define lint long long
#define pii pair<int, int>
#define vi vector<int>

#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define fore(i, b, e) for (int i = (int)b; i <= (int)e; i++)

const int maxn = 2e5 + 5;
const int inf = 1e9;

int fails[maxn];
vi list[maxn];
int qx1[maxn];
int qy1[maxn];
int qx2[maxn];
int qy2[maxn];
int pointer[maxn];
pii rooks[maxn];
int n, k, Q, m;
int tree[maxn * 4];

void upd(int i, int tl, int tr, int pos, int val)
{
    if (tl + 1 == tr)
    {
        tree[i] = val;
        return;
    }
    int m = (tl + tr) / 2;
    if (pos < m)
        upd(i * 2, tl, m, pos, val);
    else upd(i * 2 + 1, m, tr, pos, val);
    tree[i] = max(tree[i * 2], tree[i * 2 + 1]);
}

int get(int i, int tl, int tr, int L, int R)
{
    if (L >= tr || tl >= R)
        return -inf;
    if (tl == L && tr == R)
        return tree[i];
    int m = (tl + tr) / 2;
    int g1 = get(i * 2, tl, m, L, min(m, R));
    int g2 = get(i * 2 + 1, m, tr, max(m, L), R);
    return max(g1, g2);
}

bool cmp(pii first, pii second)
{
    return first.se < second.se;
}

void solve()
{
    //printf("solve\n");
    vector <pii> events;
    forn(q, Q)
    {
       events.pb(mp(qy1[q], -q));
    }
    sort(rooks, rooks + k, cmp);
    fore(i, 1, n)
        list[i].clear();
    fore(i, 1, n)
    {
        list[i].pb(0);
    }
    forn(i, k)
    {
        list[rooks[i].fi].pb(rooks[i].se);
    }
    fore(i, 1, n)
        list[i].pb(m + 1);
    fore(i, 1, n)
    {
        forn(j, list[i].size() - 1)
        {
            events.pb(mp(list[i][j], i));
        }
    }
    //printf("before sort size = %d\n", events.size());
    sort(events.begin(), events.end());
    //printf("after sort\n");
    fore(i, 1, n)
        pointer[i] = 0;
    forn(iter, events.size())
    {
        pii e = events[iter];
    //    printf("e = (%d %d %d)\n", e.t, e.first, e.second);
        if (e.second <= 0)
        {
            int number = -e.second;
            int g = get(1, 1, n + 1, qx1[number], qx2[number] + 1);
      //      printf("g = %d qy2 = %d\n", g, qy2[e.second]);
            if (g > qy2[number])
            {
                fails[number]++;
        //        printf("fails[%d]++\n", e.second);
            }
        }
        else
        {
            pointer[e.second]++;
//            printf("pointer[%d] = %d sz = %d\n", e.second, pointer[e.second], (int)list[e.second].size());
            upd(1, 1, n + 1, e.second, list[e.second][pointer[e.second]]);
        }
    }
}

int main() {
#ifdef LOCAL
    freopen("inp", "r", stdin);
    //freopen("outp", "w", stdout);
#else
    // freopen(TASKNAME ".in", "r", stdin);
    // freopen(TASKNAME ".out", "w", stdout);
#endif
    scanf("%d%d%d%d", &n, &m, &k, &Q);
    forn(i, k)
    {
        scanf("%d%d", &rooks[i].fi, &rooks[i].se);
    }
    forn(q, Q)
    {
        scanf("%d%d%d%d", &qx1[q], &qy1[q], &qx2[q], &qy2[q]);
        /*qx1[q] = rand();
        qx2[q] = rand();
        if (qx1[q] > qx2[q])
            swap(qx1[q], qx2[q]);
        qy1[q] = qy2[q] = 1;*/
    }
    solve();
    swap(n, m);
    forn(i, k)
        swap(rooks[i].fi, rooks[i].se);
    forn(q, Q)
    {
        swap(qx1[q], qy1[q]);
        swap(qx2[q], qy2[q]);
    }
    solve();
    forn(q, Q)
        if (fails[q] == 2)
            printf("NO\n");
        else printf("YES\n");

}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>

using namespace std;

#define INF 1e+9
#define mp make_pair
#define pb push_back
#define fi first
#define fs first
#define se second
#define i64 long long
#define li long long
#define lint long long
#define pii pair<int, int>
#define vi vector<int>

#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define fore(i, b, e) for (int i = (int)b; i <= (int)e; i++)

struct Event
{
    int t, first, second;
    Event(int _t, int _first, int _second) : t(_t), first(_first), second(_second) {}
};

bool operator < (Event first, Event second)
{
    if (first.t != second.t)
        return first.t < second.t;
    return first.first == -1;
}

const int maxn = 2e5 + 5;
const int inf = 1e9;

int fails[maxn];
vi list[maxn];
int qx1[maxn];
int qy1[maxn];
int qx2[maxn];
int qy2[maxn];
pii rooks[maxn];
int n, k, Q, m;
int tree[maxn * 4];

void upd(int i, int tl, int tr, int pos, int val)
{
    if (tl + 1 == tr)
    {
        tree[i] = val;
        return;
    }
    int m = (tl + tr) / 2;
    if (pos < m)
        upd(i * 2, tl, m, pos, val);
    else upd(i * 2 + 1, m, tr, pos, val);
    tree[i] = max(tree[i * 2], tree[i * 2 + 1]);
}

int get(int i, int tl, int tr, int L, int R)
{
    if (L >= tr || tl >= R)
        return -inf;
    if (tl == L && tr == R)
        return tree[i];
    int m = (tl + tr) / 2;
    int g1 = get(i * 2, tl, m, L, min(m, R));
    int g2 = get(i * 2 + 1, m, tr, max(m, L), R);
    return max(g1, g2);
}

void solve()
{
    //printf("solve\n");
    vector <Event> events;
    forn(q, Q)
    {
       events.pb(Event(qy1[q], -1, q));
    }
    fore(i, 1, n)
        list[i].clear();
    forn(i, k)
    {
        list[rooks[i].fi].pb(rooks[i].se);
    }
    fore(i, 1, n)
    {
        list[i].pb(0);
        list[i].pb(m + 1);
    }

    fore(i, 1, n)
    {
        sort(list[i].begin(), list[i].end());
        forn(j, list[i].size() - 1)
        {
            events.pb(Event(list[i][j], i, list[i][j + 1]));
        }
    }
    sort(events.begin(), events.end());
    forn(iter, events.size())
    {
        Event e = events[iter];
    //    printf("e = (%d %d %d)\n", e.t, e.first, e.second);
        if (e.first == -1)
        {
            int g = get(1, 1, n + 1, qx1[e.second], qx2[e.second] + 1);
      //      printf("g = %d qy2 = %d\n", g, qy2[e.second]);
            if (g > qy2[e.second])
            {
                fails[e.second]++;
        //        printf("fails[%d]++\n", e.second);
            }
        }
        else
        {
            upd(1, 1, n + 1, e.first, e.second);
        }
    }
}

int main() {
#ifdef LOCAL
    freopen("inp", "r", stdin);
    //freopen("outp", "w", stdout);
#else
    // freopen(TASKNAME ".in", "r", stdin);
    // freopen(TASKNAME ".out", "w", stdout);
#endif
    scanf("%d%d%d%d", &n, &m, &k, &Q);
    forn(i, k)
    {
        scanf("%d%d", &rooks[i].fi, &rooks[i].se);
    }
    forn(q, Q)
    {
        scanf("%d%d%d%d", &qx1[q], &qy1[q], &qx2[q], &qy2[q]);
    }
    solve();
    swap(n, m);
    forn(i, k)
        swap(rooks[i].fi, rooks[i].se);
    forn(q, Q)
    {
        swap(qx1[q], qy1[q]);
        swap(qx2[q], qy2[q]);
    }
    solve();
    forn(q, Q)
        if (fails[q] == 2)
            printf("NO\n");
        else printf("YES\n");

}


#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#define SIZE 100005
#define BT 1024*128*2

using namespace std;

struct Q
{
	int s,t,f,id;
	Q(int s=0,int t=0,int f=0,int id=0):s(s),t(t),f(f),id(id){}
};
struct segtree
{
	int seg[BT];
	int mum;

	void init(int n)
	{
		mum=1;
		while(mum<n) mum<<=1;
		for(int i=0;i<mum*2;i++) seg[i]=-1;
	}
	void add(int k,int x)
	{
		k+=mum-1;
		seg[k]=x;
		while(k>0)
		{
			k=(k-1)/2;
			seg[k]=min(seg[k*2+1],seg[k*2+2]);
		}
	}
	int get(int a,int b,int k,int l,int r)
	{
		if(b<=l||r<=a) return BT;
		if(a<=l&&r<=b) return seg[k];
		else
		{
			int vl=get(a,b,k*2+1,l,(l+r)/2);
			int vr=get(a,b,k*2+2,(l+r)/2,r);
			return min(vl,vr);
		}
	}
	int get(int a,int b)
	{
		return get(a,b,0,0,mum);
	}
};
segtree seg;
vector <Q> vec[2][SIZE];
vector <int> pnt[2][SIZE];
bool ok[SIZE*2];

void solve(int pos,int n,int m)
{
	seg.init(n+2);
	for(int i=0;i<m;i++)
	{
		for(int j=0;j<pnt[pos][i].size();j++)
		{
			int t=pnt[pos][i][j];
			seg.add(t,i);
			//printf("%d %d\n",t,i);
		}
		for(int j=0;j<vec[pos][i].size();j++)
		{
			Q q=vec[pos][i][j];
			//printf("[%d %d]%d %d %d\n",q.s,q.t,q.id,seg.get(q.s,q.t+1),q.f);
			if(seg.get(q.s,q.t+1)>=q.f)
			{
				ok[q.id]=true;
			}
		}
	}
}
int main()
{
	int n,m,k,q;
	scanf("%d %d %d %d",&n,&m,&k,&q);
	for(int i=0;i<k;i++)
	{
		int x,y;
		scanf("%d %d",&x,&y);x--;y--;
		pnt[0][x].push_back(y);//0 ... solve(0,m,n)
		pnt[1][y].push_back(x);//1 ... solve(1,n,m)
	}
	for(int i=0;i<q;i++)
	{
		int a,b,c,d;
		scanf("%d %d %d %d",&a,&b,&c,&d);a--;b--;c--;d--;
		//(a,b) -> (c,d)
		vec[0][c].push_back(Q(b,d,a,i));
		vec[1][d].push_back(Q(a,c,b,i));
	}
	memset(ok,false,sizeof(ok));
	solve(0,m,n);
	solve(1,n,m);
	for(int i=0;i<q;i++)
	{
		if(ok[i]) puts("YES");
		else puts("NO");
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef long double ld;

#define pb push_back
#define mp make_pair

#define write(x) cout << #x << " = " << x << ' '
#define writeln(x) cout << #x << " = " << x << endl

const int INF = 1e9 + 100;
const int maxn = 200010;

struct point {
    int x, l, r, t, n;
    point() {}
    point(int x, int l, int r, int n): x(x), l(l), r(r), t(1), n(n) {}
    point(int x, int y, int n): x(x), l(y), r(y), t(0), n(n) {}
};

bool cmp(point a, point b) {
    if (a.x == b.x) {
        if (a.t == b.t) {
            return a.n < b.n;
        }
        return a.t < b.t;
    }
    return a.x < b.x;
}

vector<point> a, b;
int a2[maxn], b2[maxn];
int t[2][maxn * 4];
bool ans1[maxn], ans2[maxn];

int get_min(int v, int tl, int tr, int l, int r, int c) {
    if (l > tr || r < tl) return INF;
    if (l <= tl && tr <= r) return t[c][v];
    int tm = (tl + tr) / 2;
    return min(get_min(v * 2, tl, tm, l, r, c), get_min(v * 2 + 1, tm + 1, tr, l, r, c));
}

void add(int v, int tl, int tr, int x, int s, int c) {
    if (x < tl || x > tr) return;
    if (tl == tr) {
        t[c][v] = s;
        return;
    }
    int tm = (tl + tr) / 2;
    add(v * 2, tl, tm, x, s, c);
    add(v * 2 + 1, tm + 1, tr, x, s, c);
    t[c][v] = min(t[c][v * 2], t[c][v * 2 + 1]);
}

int main() {

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE

    int n, m, k, q;
    scanf("%d%d%d%d", &n, &m, &k, &q);
    for (int i = 0; i < k; ++i) {
        int x, y;
        scanf("%d%d", &x, &y);
        a.pb(point(x, y, i));
        b.pb(point(y, x, i));
    }
    for (int i = 0; i < q; ++i) {
        int x, y, z, t;
        scanf("%d%d%d%d", &x, &y, &z, &t);
        a.pb(point(z, y, t, i));
        a2[i] = x;
        b.pb(point(t, x, z, i));
        b2[i] = y;
    }
    int N;
    sort(a.begin(), a.end(), cmp);
    N = a.size();
    for (int i = 0; i < N; ++i) {
        if (a[i].t == 0) add(1, 1, m, a[i].l, a[i].x, 0);
        else if (get_min(1, 1, m, a[i].l, a[i].r, 0) >= a2[a[i].n]) ans1[a[i].n] = true;
    }
    sort(b.begin(), b.end(), cmp);
    N = b.size();
    for (int i = 0; i < N; ++i) {
        if (b[i].t == 0) add(1, 1, n, b[i].l, b[i].x, 1);
        else if (get_min(1, 1, n, b[i].l, b[i].r, 1) >= b2[b[i].n]) ans2[b[i].n] = true;
    }

    for (int i = 0; i < q; ++i) {
        if (ans1[i] || ans2[i]) printf("YES\n");
        else printf("NO\n");
    }

    return 0;
}


// In the name of God
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define F first
#define S second
using namespace std;
typedef pair< int , int > pii;
typedef pair< pii , pii > ppi;

const int maxn = 1000 * 1000 + 10;
int s[maxn*4];
bool ans[maxn*4];
vector< int >vr[maxn] , vc[maxn];
vector< ppi >Qr[maxn] , Qc[maxn];

inline void add( int l , int r , int id,  int val , int ind )
{
    if( l == r )    {
        s[ind] = val;
        return;
    }
    int mid = (l+r)/2;
    int lc = 2*ind , rc = 2*ind+1;
    if( id <= mid )
        add( l , mid , id , val , lc);
    else
        add( mid+1 , r , id , val ,rc);
    s[ind] = min(s[rc],s[lc]);
}

inline int get( int l , int r , int fi , int se, int ind )
{
    if( l == fi && se == r )
        return s[ind];
    int mid = (l+r)/2;
    if( se <= mid )
        return get( l , mid , fi , se , 2*ind );
    if( fi > mid )
        return get( mid+1 , r , fi , se , 2*ind+1 );
    return min( get( l , mid , fi , mid , 2*ind) , get( mid+1 , r , mid+1 , se , 2*ind+1 ) );
}

int main()
{
    ios_base::sync_with_stdio(false);
    int n , m , k , q;
    cin >> n >> m >> k >> q;
    for(int i=1;i<=k;++i)   {
        int x , y;
        cin >> x >> y;
        vr[x].pb(y);
        vc[y].pb(x);
    }

    for(int i=1;i<=q;++i)   {
        int x1 , x2 , y1 , y2;
        cin >> x1 >> y1 >> x2 >> y2;
        swap( x1 , x2 );
        swap( y1 , y2 );
        Qr[x1].pb( { {x2,y2} , {y1,i} } );
        Qc[y1].pb( { {x2,y2} , {x1,i} } );
    }

    for(int i=1;i<=n;++i)   {
        for(int j=0;j<vr[i].size();++j)
            add( 1 , m , vr[i][j] , i , 1 );
        for(int j=0;j<Qr[i].size();++j) {
            int mi = get( 1 , m , Qr[i][j].F.S , Qr[i][j].S.F , 1 );
            if( mi >= Qr[i][j].F.F )
                ans[Qr[i][j].S.S] = true;
        }
    }

    memset( s , 0 , sizeof s );

    for(int i=1;i<=m;++i)   {
        for(int j=0;j<vc[i].size();++j)
            add( 1 , n , vc[i][j] , i , 1 );
        for(int j=0;j<Qc[i].size();++j)    {
            int mi = get( 1 , n , Qc[i][j].F.F , Qc[i][j].S.F , 1 );
            if( mi >= Qc[i][j].F.S )
                ans[Qc[i][j].S.S] = true;
        }
    }

    for(int i=1;i<=q;++i)
        if(ans[i])
            cout << "YES" << endl;
        else
            cout << "NO" << endl;

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<memory.h>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<sstream>
#include<cstring>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define SS stringstream
#define sqr(x) ((x)*(x))
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define CC(x) cout << (x) << endl
#define pw(x) (1ll<<(x))
#define buli(x) __builtin_popcountll(x)
#define M 1000000007
#define N 411111

#define TASK "1"

using namespace std;
typedef pair<int,int> pt;

int n, m, k, q;
int x[N], y[N], a[N], b[N], aa[N], bb[N];
int ans[N];
int mi[2000222];

void init(int pos, int l, int r) {
	mi[pos] = -1;
	if (l == r) return;
	init(pos + pos, l, (l + r) / 2);
	init(pos + pos + 1, (l + r) / 2 + 1, r);
}

void mod(int pos, int l, int r, int x, int v) {
	if (x < l || x > r) return;
	if (l == r) {
		mi[pos] = v;
		return;
	}
	mod(pos + pos, l, (l + r) / 2, x, v);
	mod(pos + pos + 1, (l + r) / 2 + 1, r, x, v);

	mi[pos] = min(mi[pos + pos], mi[pos + pos + 1]);
}

int fin(int pos, int l, int r, int ll, int rr) {
	ll = max(ll, l);
	rr = min(rr, r);
	if (ll > rr) return 1e9;
	if (l == ll && r == rr) return mi[pos];

	return min(fin(pos + pos, l, (l + r) / 2, ll, rr),
	fin(pos + pos + 1, (l + r) / 2 + 1, r, ll, rr) );
}

void solve() {
	vector<pair<int, int> > ev;
	for (int i = 0; i < k; i++) {
		ev.pb(mp(y[i], -(i + 1)));
	}
	for (int i = 0; i < q; i++) {
		ev.pb(mp(bb[i], i + 1));
	}
	sort(ev.begin(), ev.end());
	init(1, 0, n - 1);
	for (int i = 0; i < ev.size(); i++) {
		int id = ev[i].S;
		if (id < 0) {
			id = (-id) - 1;
			mod(1, 0, n - 1, x[id], y[id]);
		} else {
			id = id - 1;
			if (fin(1, 0, n - 1, a[id], aa[id]) >= b[id]) ans[id] = 1;
		}
	}
}

int main(){
//	freopen(TASK".in","r",stdin);
//	freopen(TASK".out","w",stdout);
	cin >> n >> m >> k >> q;
	for (int i = 0; i < k; i++) {
		scanf("%d%d", &x[i], &y[i]);
		x[i]--;
		y[i]--;
	}
	for (int i = 0; i < q; i++) {
		scanf("%d%d%d%d", &a[i], &b[i], &aa[i], &bb[i]);
		a[i]--;
		b[i]--;
		aa[i]--;
		bb[i]--;

		ans[i] = 0;
	}
	solve();
	for (int i = 0; i < k; i++) swap(x[i], y[i]);
	for (int i = 0; i < q; i++) {
		swap(a[i], b[i]);
		swap(aa[i], bb[i]);
	}
	swap(n, m);
	solve();

	for (int i = 0; i < q; i++) if (ans[i]) puts("YES"); else puts("NO");

	return 0;

}


#include <iostream>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

struct pnt{
	int x, y;
};

struct pr{
	int d, q;
	pr() {}
	pr(int d, int q) : d(d), q(q) {}
	friend bool operator < (pr a, pr b)
	{
		if (a.d != b.d)
			return a.d < b.d;
		return a.q < b.q;
	}
};

const int N = 200000 + 20;
bool ok[N];
int t[4*N];

void build(int v, int tl, int tr)
{
	if (tl == tr)
	{
		t[v] = -1;
		return;
	}
	int tm = (tl + tr)/2;
	build(2*v, tl, tm);
	build(2*v + 1, tm + 1, tr);
	t[v] = -1;
}

void upd(int v, int tl, int tr, int wh, int vl)
{
	while (tl < tr)
	{
		int tm = (tl + tr)/2;
		if (wh <= tm)
		{
			tr = tm;
			v = 2*v;
		}
		else
		{
			tl = tm + 1;
			v = 2*v + 1;
		}
	}
	t[v] = vl;
	v /= 2;
	while (v >= 1)
	{
		t[v] = min(t[2*v], t[2*v + 1]);
		v >>= 1;
	}
}

const int INF = 1e9 + 7;

int mn(int v, int tl, int tr, int l, int r)
{
	if (l > r)
		return INF;
	if (tl == l && r == tr)
		return t[v];
	int tm = (tl + tr)/2;
	return min(mn(2*v, tl, tm, l, min(tm, r)),
		mn(2*v + 1, tm + 1, tr, max(tm + 1, l), r));
}

int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(0);
	int n, m, k, q;
	scanf("%d %d %d %d", &n, &m, &k, &q);
	swap(n, m);

	vector<pnt> lad(k);
	for (int i = 0; i < k; ++i)
	{
		scanf("%d %d", &lad[i].x, &lad[i].y);
		--lad[i].x;
		--lad[i].y;
	}

	vector<pr> r(q), d(q);
	vector<int> x1(q), x2(q), y1(q), y2(q);
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d %d %d", &x1[i], &y1[i], &x2[i], &y2[i]);
		--y1[i];
		--y2[i];
		--x1[i];
		--x2[i];
		r[i].d = x2[i];
		r[i].q = i;
		d[i].d = y2[i];
		d[i].q = i;
	}

	for (int i = 0; i < k; ++i)
	{
		r.push_back(pr(lad[i].x, -i - 1));
		d.push_back(pr(lad[i].y, -i - 1));
	}
	sort(r.begin(), r.end());
	sort(d.begin(), d.end());

	build(1, 0, n - 1);
	for (int i = 0; i < r.size(); ++i)
	{
		if (r[i].q < 0)
			upd(1, 0, n - 1, lad[-r[i].q - 1].y, r[i].d);
		else
		{
			int t = mn(1, 0, n - 1, y1[r[i].q], y2[r[i].q]);
			if (t >= x1[r[i].q])
				ok[r[i].q] = true;
		}
	}

	build(1, 0, m - 1);
	for(int i = 0; i < d.size(); ++i)
	{
		if (d[i].q < 0)
			upd(1, 0, m - 1, lad[-d[i].q - 1].x, d[i].d);
		else
		{
			int t = mn(1, 0, m - 1, x1[d[i].q], x2[d[i].q]);
			if (t >= y1[d[i].q])
				ok[d[i].q] = true;
		}
	}

	for (int i = 0; i < q; ++i)
		printf((ok[i] ? "YES\n" : "NO\n"));
	return 0;

}


#include <iostream>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

struct pnt{
	int x, y;
};

struct pr{
	int d, q;
	pr() {}
	pr(int d, int q) : d(d), q(q) {}
	friend bool operator < (pr a, pr b)
	{
		if (a.d != b.d)
			return a.d < b.d;
		return a.q < b.q;
	}
};

const int N = 200000 + 20;
bool ok[N];
int t[4*N];

void build(int v, int tl, int tr)
{
	if (tl == tr)
	{
		t[v] = -1;
		return;
	}
	int tm = (tl + tr)/2;
	build(2*v, tl, tm);
	build(2*v + 1, tm + 1, tr);
	t[v] = -1;
}

void upd(int v, int tl, int tr, int wh, int vl)
{
	while (tl < tr)
	{
		int tm = (tl + tr)/2;
		if (wh <= tm)
		{
			tr = tm;
			v = 2*v;
		}
		else
		{
			tl = tm + 1;
			v = 2*v + 1;
		}
	}
	t[v] = vl;
	v /= 2;
	while (v >= 1)
	{
		t[v] = min(t[2*v], t[2*v + 1]);
		v >>= 1;
	}
}

const int INF = 1e9 + 7;

int mn(int v, int tl, int tr, int l, int r)
{
	if (l > r)
		return INF;
	if (tl == l && r == tr)
		return t[v];
	int tm = (tl + tr)/2;
	return min(mn(2*v, tl, tm, l, min(tm, r)),
		mn(2*v + 1, tm + 1, tr, max(tm + 1, l), r));
}

int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(0);
	int n, m, k, q;
	scanf("%d %d %d %d", &n, &m, &k, &q);

	vector<pnt> lad(k);
	for (int i = 0; i < k; ++i)
	{
		scanf("%d %d", &lad[i].x, &lad[i].y);
		--lad[i].x;
		--lad[i].y;
	}

	vector<pr> r(q), d(q);
	vector<int> x1(q), x2(q), y1(q), y2(q);
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d %d %d", &x1[i], &y1[i], &x2[i], &y2[i]);
		--y1[i];
		--y2[i];
		--x1[i];
		--x2[i];
		r[i].d = x2[i];
		r[i].q = i;
		d[i].d = y2[i];
		d[i].q = i;
	}

	for (int i = 0; i < k; ++i)
	{
		r.push_back(pr(lad[i].x, -i - 1));
		d.push_back(pr(lad[i].y, -i - 1));
	}
	sort(r.begin(), r.end());
	sort(d.begin(), d.end());

	build(1, 0, n - 1);
	for (int i = 0; i < r.size(); ++i)
	{
		if (r[i].q < 0)
			upd(1, 0, n - 1, lad[-r[i].q - 1].y, r[i].d);
		else
		{
			int t = mn(1, 0, n - 1, y1[r[i].q], y2[r[i].q]);
			if (t >= x1[r[i].q])
				ok[r[i].q] = true;
		}
	}

	build(1, 0, m - 1);
	for(int i = 0; i < d.size(); ++i)
	{
		if (r[i].q < 0)
			upd(1, 0, n - 1, lad[-r[i].q - 1].x, r[i].d);
		else
		{
			int t = mn(1, 0, n - 1, x1[r[i].q], x2[r[i].q]);
			if (t >= y1[r[i].q])
				ok[r[i].q] = true;
		}
	}

	for (int i = 0; i < q; ++i)
		printf((ok[i] ? "YES\n" : "NO\n"));
	return 0;

}


#include <iostream>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

struct pnt{
	int x, y;
};

struct pr{
	int d, q;
	pr() {}
	pr(int d, int q) : d(d), q(q) {}
	friend bool operator < (pr a, pr b)
	{
		if (a.d != b.d)
			return a.d < b.d;
		return a.q < b.q;
	}
};

const int N = 200000 + 20;
bool ok[N];
int t[4*N];

void build(int v, int tl, int tr)
{
	if (tl == tr)
	{
		t[v] = -1;
		return;
	}
	int tm = (tl + tr)/2;
	build(2*v, tl, tm);
	build(2*v + 1, tm + 1, tr);
	t[v] = -1;
}

void upd(int v, int tl, int tr, int wh, int vl)
{
	while (tl < tr)
	{
		int tm = (tl + tr)/2;
		if (wh <= tm)
		{
			tr = tm;
			v = 2*v;
		}
		else
		{
			tl = tm + 1;
			v = 2*v + 1;
		}
	}
	t[v] = vl;
	v /= 2;
	while (v >= 1)
	{
		t[v] = min(t[2*v], t[2*v + 1]);
		v >>= 1;
	}
}

const int INF = 1e9 + 7;

int mn(int v, int tl, int tr, int l, int r)
{
	if (l > r)
		return INF;
	if (tl == l && r == tr)
		return t[v];
	int tm = (tl + tr)/2;
	return min(mn(2*v, tl, tm, l, min(tm, r)),
		mn(2*v + 1, tm + 1, tr, max(tm + 1, l), r));
}

int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(0);
	int n, m, k, q;
	scanf("%d %d %d %d", &n, &m, &k, &q);
	swap(n, m);

	vector<pnt> lad(k);
	for (int i = 0; i < k; ++i)
	{
		scanf("%d %d", &lad[i].x, &lad[i].y);
		--lad[i].x;
		--lad[i].y;
	}

	vector<pr> r(q), d(q);
	vector<int> x1(q), x2(q), y1(q), y2(q);
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d %d %d", &x1[i], &y1[i], &x2[i], &y2[i]);
		--y1[i];
		--y2[i];
		--x1[i];
		--x2[i];
		r[i].d = x2[i];
		r[i].q = i;
		d[i].d = y2[i];
		d[i].q = i;
	}

	for (int i = 0; i < k; ++i)
	{
		r.push_back(pr(lad[i].x, -i - 1));
		d.push_back(pr(lad[i].y, -i - 1));
	}
	sort(r.begin(), r.end());
	sort(d.begin(), d.end());

	build(1, 0, n - 1);
	for (int i = 0; i < r.size(); ++i)
	{
		if (r[i].q < 0)
			upd(1, 0, n - 1, lad[-r[i].q - 1].y, r[i].d);
		else
		{
			int t = mn(1, 0, n - 1, y1[r[i].q], y2[r[i].q]);
			if (t >= x1[r[i].q])
				ok[r[i].q] = true;
		}
	}

	build(1, 0, m - 1);
	for(int i = 0; i < d.size(); ++i)
	{
		if (r[i].q < 0)
			upd(1, 0, m - 1, lad[-r[i].q - 1].x, r[i].d);
		else
		{
			int t = mn(1, 0, m - 1, x1[r[i].q], x2[r[i].q]);
			if (t >= y1[r[i].q])
				ok[r[i].q] = true;
		}
	}

	for (int i = 0; i < q; ++i)
		printf((ok[i] ? "YES\n" : "NO\n"));
	return 0;

}


#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define y1 RooK
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int x[MAXN],y[MAXN],x1[MAXN],y1[MAXN],x2[MAXN],y2[MAXN];
int n,m,k,q,p[MAXN],s[MAXN<<2];
vector<int>adj[MAXN],query[MAXN],daj[MAXN];
bool ans[MAXN][2];
void upd(int p,int v,int nd,int x,int y){
	if(x==y){
		s[nd]=v;
		return;
	}
	int mid=(x+y)>>1;
	if(p<=mid)
		upd(p,v,nd<<1,x,mid);
	else
		upd(p,v,nd<<1|1,mid+1,y);
	s[nd]=max(s[nd<<1],s[nd<<1|1]);
}
int tap(int l,int r,int nd,int x,int y){
	if(l>y or x>r)
		return 0;
	if(l<=x and y<=r)
		return s[nd];
	int mid=(x+y)>>1;
	int i1=tap(l,r,nd<<1,x,mid);
	int i2=tap(l,r,nd<<1|1,mid+1,y);
	return max(i1,i2);
}
void solve(bool type){
	if(!type){
		for(int i=1;i<=m;i++)
			upd(i,daj[i][p[i]++],1,1,m);
		for(int i=1;i<=n;i++){
			tr(it,query[i])
				if(tap(y1[*it],y2[*it],1,1,m)>x2[*it])
					ans[*it][0]=true;
			tr(it,adj[i])
				upd(*it,daj[*it][p[*it]++],1,1,m);
		}
	}
	else{
		for(int i=1;i<=n;i++)
			upd(i,daj[i][p[i]++],1,1,n);
		for(int i=1;i<=m;i++){
			tr(it,query[i])
				if(tap(x1[*it],x2[*it],1,1,n)>y2[*it])
					ans[*it][1]=true;
			tr(it,adj[i])
				upd(*it,daj[*it][p[*it]++],1,1,n);
		}
	}
}
void reset(){
	memset(s,0,sizeof s);
	memset(p,0,sizeof p);
	for(int i=1;i<=n;i++)
		adj[i].clear(),query[i].clear();
	for(int i=1;i<=m;i++)
		daj[i].clear();
	for(int i=1;i<=k;i++){
		adj[y[i]].pb(x[i]);
		daj[x[i]].pb(y[i]);
	}
	for(int i=1;i<=n;i++){
		sort(all(daj[i]));
		daj[i].pb(INF);
	}
	for(int i=1;i<=q;i++)
		query[y1[i]].pb(i);
}
int main(){
	#ifndef ONLINE_JUDGE
    freopen("file.in", "r", stdin);
	#endif
	scanf("%d%d%d%d",&n,&m,&k,&q);
	for(int i=1;i<=k;i++){
		scanf("%d%d",x+i,y+i);
		adj[x[i]].pb(y[i]);
		daj[y[i]].pb(x[i]);
	}
	for(int i=1;i<=m;i++){
		sort(all(daj[i]));
		daj[i].pb(INF);
	}
	for(int i=1;i<=q;i++){
		scanf("%d%d%d%d",x1+i,y1+i,x2+i,y2+i);
		query[x1[i]].pb(i);
	}
	solve(0);reset();solve(1);
	for(int i=1;i<=q;i++){
		if(ans[i][0]&ans[i][1])
			puts("NO");
		else
			puts("YES");
	}
	return 0;
}


#include "bits/stdc++.h"
#define MAXN 200009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define y1 RooK
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int x[MAXN],y[MAXN],x1[MAXN],y1[MAXN],x2[MAXN],y2[MAXN];
int n,m,k,q,p[MAXN],s[MAXN<<2];
vector<int>adj[MAXN],query[MAXN],daj[MAXN];
bool ans[MAXN][2];
void upd(int p,int v,int nd,int x,int y){
	if(x==y){
		s[nd]=v;
		return;
	}
	int mid=(x+y)>>1;
	if(p<=mid)
		upd(p,v,nd<<1,x,mid);
	else
		upd(p,v,nd<<1|1,mid+1,y);
	s[nd]=max(s[nd<<1],s[nd<<1|1]);
}
int tap(int l,int r,int nd,int x,int y){
	if(l>y or x>r)
		return 0;
	if(l<=x and y<=r)
		return s[nd];
	int mid=(x+y)>>1;
	int i1=tap(l,r,nd<<1,x,mid);
	int i2=tap(l,r,nd<<1|1,mid+1,y);
	return max(i1,i2);
}
void solve(bool type){
	if(!type){
		for(int i=1;i<=m;i++)
			upd(i,daj[i][p[i]++],1,1,m);
		for(int i=1;i<=n;i++){
			tr(it,query[i])
				if(tap(y1[*it],y2[*it],1,1,m)>x2[*it])
					ans[*it][0]=true;
			tr(it,adj[i])
				upd(*it,daj[*it][p[*it]++],1,1,m);
		}
	}
	else{
		for(int i=1;i<=n;i++)
			upd(i,daj[i][p[i]++],1,1,n);
		for(int i=1;i<=m;i++){
			tr(it,query[i])
				if(tap(x1[*it],x2[*it],1,1,n)>y2[*it])
					ans[*it][1]=true;
			tr(it,adj[i])
				upd(*it,daj[*it][p[*it]++],1,1,n);
		}
	}
}
void reset(){
	memset(s,0,sizeof s);
	memset(p,0,sizeof p);
	for(int i=1;i<=n;i++)
		adj[i].clear(),query[i].clear();
	for(int i=1;i<=m;i++)
		daj[i].clear();
	for(int i=1;i<=k;i++){
		adj[y[i]].pb(x[i]);
		daj[x[i]].pb(y[i]);
	}
	for(int i=1;i<=n;i++){
		sort(all(daj[i]));
		daj[i].pb(INF);
	}
	for(int i=1;i<=q;i++)
		query[y1[i]].pb(i);
}
int main(){
	#ifndef ONLINE_JUDGE
    freopen("file.in", "r", stdin);
	#endif
	scanf("%d%d%d%d",&n,&m,&k,&q);
	for(int i=1;i<=k;i++){
		scanf("%d%d",x+i,y+i);
		adj[x[i]].pb(y[i]);
		daj[y[i]].pb(x[i]);
	}
	for(int i=1;i<=m;i++){
		sort(all(daj[i]));
		daj[i].pb(INF);
	}
	for(int i=1;i<=q;i++){
		scanf("%d%d%d%d",x1+i,y1+i,x2+i,y2+i);
		query[x1[i]].pb(i);
	}
	solve(0);reset();solve(1);
	for(int i=1;i<=q;i++){
		if(ans[i][0]&ans[i][1])
			puts("NO");
		else
			puts("YES");
	}
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<ctime>
#include<cstring>
#include<cctype>

#include<iostream>
#include<algorithm>
#include<utility>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<deque>
using namespace std;

#ifdef WIN32
	#define lld "%I64d"
	#define llu "%I64u"
#else
	#define lld "%lld"
	#define llu "%llu"
#endif

typedef unsigned int uint;
typedef long long LL;
typedef unsigned long long ULL;
typedef double dbl;
typedef long double LD;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second

#define forn(i,n) for(int i=0;i<(n);++i)
#define fornr(i,n) for(int i=(n)-1;i>=0;--i)
#define forab(i,a,b) for(int i=(a);i<(b);++i)
#define forba(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define forit(i,A) for(__typeof((A).begin()) i=(A).begin();i!=(A).end();++i)
#define all(A) (A).begin(),(A).end()

struct ev{
	int t, data, type;
	ev(int t=0,int data=0,int type=0):t(t),data(data),type(type){}
	inline bool operator<(const ev &B) const{
		return t<B.t || (t==B.t && type<B.type);
	}
};

vector<ev> EvX, EvY;
const int ST_SZ=1<<17, ST_SZ2=2*ST_SZ, MAX_Q=2e5+10;
#define y1 usdhfsdfksdf
int x1[MAX_Q], y1[MAX_Q], x2[MAX_Q], y2[MAX_Q];
int ST[ST_SZ2];
bool Good[MAX_Q];
const int INF=1e9;

inline int Get(int L,int R){
	int S=INF;
	for(L+=ST_SZ,R+=ST_SZ;L<R;L>>=1, R>>=1){
		if(L&1) S=min(S,ST[L++]);
		if(R&1) S=min(S,ST[--R]);
	}
	return S;
}

inline void Set(int k,int x){
	ST[k+=ST_SZ]=x;
	for(k>>=1;k>0;k>>=1)
		ST[k]=min(ST[k*2],ST[k*2+1]);
}

int main(){
#ifdef LOCAL
	assert(freopen("test.in","r",stdin));
	assert(freopen("test.out","w",stdout));
#endif

	int N,M,K,Q;
	scanf("%d%d%d%d",&N,&M,&K,&Q);
	forn(i,K){
		int x,y;
		scanf("%d%d",&x,&y);
		EvX.pb(ev(x,y,0));
		EvY.pb(ev(y,x,0));
	}
	forn(i,Q){
		scanf("%d%d%d%d",&x1[i],&y1[i],&x2[i],&y2[i]);
		EvX.pb(ev(x2[i],i,1));
		EvY.pb(ev(y2[i],i,1));
	}

	sort(all(EvX));
	forit(e,EvX){
		if(e->type==0)
			Set(e->data,e->t);
		else if(Get(y1[e->data],y2[e->data]+1)>=x1[e->data])
			Good[e->data]=1;
	}

	forn(i,ST_SZ2)
		ST[i]=0;

	sort(all(EvY));
	forit(e,EvY){
		if(e->type==0)
			Set(e->data,e->t);
		else if(Get(x1[e->data],x2[e->data]+1)>=y1[e->data])
			Good[e->data]=1;
	}

	forn(i,Q)
		puts(Good[i]?"YES":"NO");

	return 0;
}


#include <iostream>
#include <cstdio>
#include <ctime>
#include <cassert>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;

#ifdef WIN32
	#define lld "%I64d"
#else
	#define lld "%lld"
#endif

#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double db;

const int M = 6 * 1e5 + 1050;
const ll Q = 1e18 + 7;

struct node{
	int x, y, l, r, val, ma;
};

struct que{
	int x1, x2, y1, y2;
};

bool res[M][2];
vector<pair<pair<int, int>, pair<int, int> > > g;
node tree[M];
vector<int> qqq[M];
int U;

int new_node(int x, int val){
	tree[U].x = x;
	tree[U].y = rand();
	tree[U].l = tree[U].r = -1;
	tree[U].val = tree[U].ma = val;
	U++;
	return U - 1;
}
int mama(int t){
	if (t == -1)
		return -1;
	return tree[t].ma;
}

void recalc(int t){
	tree[t].ma = max(max(mama(tree[t].l), mama(tree[t].r)), tree[t].val);
}

pair<int, int> split(int t, int x){
	if (t == -1)
		return mp(-1, -1);
	if (tree[t].x >= x){
		pair<int, int> a = split(tree[t].l, x);
		tree[t].l = a.second;
		recalc(t);
		return mp(a.first, t);
	}
	else{
		pair<int, int> a = split(tree[t].r, x);
		tree[t].r = a.first;
		recalc(t);
		return mp(t, a.second);
	}
}

int merg(int l, int r){
	if (l == -1)
		return r;
	if (r == -1)
		return l;
	if (tree[l].y > tree[r].y){
		tree[l].r = merg(tree[l].r, r);
		recalc(l);
		return l;
	}
	else{
		tree[r].l = merg(l, tree[r].l);
		recalc(r);
		return r;
	}
}

void add(int x1, int x2, int i){
	g.pb(mp(mp(x1 + 1, 0), mp(x2 - 1, i)));
	g.pb(mp(mp(x2 - 1, 2), mp(x1 + 1, i)));
	cerr << "^" << i << " " << x1+1 << " " << x2-1 << endl;
}

void solve(int tq, vector<pair<int, int> > &lad, vector<que> query, int n, int m){
	for (int i =0; i < (int)lad.size(); i++)
		cerr << lad[i].first << " " << lad[i].second << endl;
	for (int i = 0; i <= n; i++)
		qqq[i].resize(0);
	for (int i = 0; i < (int)lad.size(); i++)
		qqq[lad[i].first].pb(lad[i].second);
	g.resize(0);
	for (int i = 1; i <= n; i++){
		if ((int)qqq[i].size() == 0){
		    add(0, m + 1, i);
			continue;
		}
		for (int j = 0; j < (int)qqq[i].size() - 1; j++)
			add(qqq[i][j], qqq[i][j + 1], i);
		if (qqq[i][0] > 1)
			add(0, qqq[i][0], i);
		if (qqq[i][(int)qqq[i].size() - 1] < m)
			add(qqq[i][(int)qqq[i].size() - 1], m + 1, i);
	}
	for (int i = 0; i < (int)query.size(); i++)
		g.pb(mp(mp(query[i].y1, 1), mp(i, -1)));
	sort(g.begin(), g.end());
	int t = -1;
	U = 0;
	for (int i = 0; i < (int)g.size(); i++){
		cerr << g[i].first.first << " " << g[i].first.second << " " << g[i].second.first << " " << g[i].second.second << endl;

		if (g[i].first.second == 0){
			int cur = new_node(g[i].second.second, g[i].second.first);
			pair<int, int> a = split(t, tree[cur].x);
			t = merg(a.first, cur);
			t = merg(t, a.second);
		}
		if (g[i].first.second == 1){
			cerr << "F" << endl;
			int num = g[i].second.first;
			pair<int, int> a = split(t, query[num].x1);
			pair<int, int> b = split(a.second, query[num].x2 + 1);
			if (b.first == -1 || tree[b.first].ma < query[num].y2)
				res[num][tq] = 0;
			else
				res[num][tq] = 1;
		//	cerr << b.first << endl;

			t = merg(a.first, b.first);
			t = merg(t, b.second);
		}
		if (g[i].first.second == 2){
			int cur = g[i].second.second;
			pair<int, int> a = split(t, cur);
			pair<int, int> b = split(a.second, cur + 1);
			t = merg(a.first, b.second);
		}
	}
}

int main(){
	srand(time(NULL));
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m, k, q;
	int x1, x2, y1, y2, x, y;
	scanf("%d%d%d%d", &n, &m, &k, &q);
	vector<pair<int, int> >l;
	vector<que> r;
	for (int i = 0; i < k; i++){
		scanf("%d%d", &x, &y);
		l.pb(mp(x, y));
	}
	for (int i = 0; i < q; i++){
		que que1;
		scanf("%d%d%d%d", &que1.x1, &que1.y1, &que1.x2, &que1.y2);
		r.pb(que1);
	}
	solve(0, l, r, n, m);
	for (int i = 0; i < k; i++){
		x = l[i].first;
		y = l[i].second;
		l[i].first = y;
		l[i].second = n + 1 - x;
		//cout << l[i].first << " " << l[i].second << endl;
	}
	for (int i = 0; i < q; i++){
		x1 = r[i].x1;
		y1 = r[i].y1;
		x2 = r[i].x2;
		y2 = r[i].y2;
		r[i].x2 = y2;
		r[i].y2 = n + 1 - x1;
		r[i].x1 = y1;
		r[i].y1 = n + 1 - x2;
		//cout << r[i].x1 << " " << r[i].y1 << " " << r[i].x2 << " " << r[i].y2 << endl;
	}
	solve(1, l, r, m, n);
	for (int i = 0; i < q; i++){
		cerr << "res" << " " << i << " " << res[i][0] << " " << res[i][1] << endl;
		if (res[i][0] && res[i][1])
			printf("NO\n");
		else
			printf("YES\n");
		}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <ctime>
#include <cassert>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;

#ifdef WIN32
	#define lld "%I64d"
#else
	#define lld "%lld"
#endif

#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double db;

const int M = 6 * 1e5 + 1050;
const ll Q = 1e18 + 7;

struct node{
	int x, y, l, r, val, ma;
};

struct que{
	int x1, x2, y1, y2;
};

bool res[M][2];
vector<pair<pair<int, int>, pair<int, int> > > g;
node tree[M];
vector<int> qqq[M];
int U;

int new_node(int x, int val){
	tree[U].x = x;
	tree[U].y = rand();
	tree[U].l = tree[U].r = -1;
	tree[U].val = tree[U].ma = val;
	U++;
	return U - 1;
}
int mama(int t){
	if (t == -1)
		return -1;
	return tree[t].ma;
}

void recalc(int t){
	tree[t].ma = max(max(mama(tree[t].l), mama(tree[t].r)), tree[t].val);
}

pair<int, int> split(int t, int x){
	if (t == -1)
		return mp(-1, -1);
	if (tree[t].x >= x){
		pair<int, int> a = split(tree[t].l, x);
		tree[t].l = a.second;
		recalc(t);
		return mp(a.first, t);
	}
	else{
		pair<int, int> a = split(tree[t].r, x);
		tree[t].r = a.first;
		recalc(t);
		return mp(t, a.second);
	}
}

int merg(int l, int r){
	if (l == -1)
		return r;
	if (r == -1)
		return l;
	if (tree[l].y > tree[r].y){
		tree[l].r = merg(tree[l].r, r);
		recalc(l);
		return l;
	}
	else{
		tree[r].l = merg(l, tree[r].l);
		recalc(r);
		return r;
	}
}

void add(int x1, int x2, int i){
	g.pb(mp(mp(x1 + 1, 0), mp(x2 - 1, i)));
	g.pb(mp(mp(x2 - 1, 1), mp(x1 + 1, i)));
	cerr << "^" << i << " " << x1 << " " << x2 << endl;
}

void solve(int tq, vector<pair<int, int> > &lad, vector<que> query, int n, int m){
	for (int i =0; i < (int)lad.size(); i++)
		cerr << lad[i].first << " " << lad[i].second << endl;
	for (int i = 0; i <= n; i++)
		qqq[i].resize(0);
	for (int i = 0; i < (int)lad.size(); i++)
		qqq[lad[i].first].pb(lad[i].second);
	g.resize(0);
	for (int i = 1; i <= n; i++){
		if ((int)qqq[i].size() == 0){
		    add(0, m + 1, i);
			continue;
		}
		for (int j = 0; j < (int)qqq[i].size() - 1; j++)
			add(qqq[i][j], qqq[i][j + 1], i);
		if (qqq[i][0] > 1)
			add(0, qqq[i][0], i);
		if (qqq[i][(int)qqq[i].size() - 1] < m)
			add(qqq[i][(int)qqq[i].size() - 1], m + 1, i);
	}
	for (int i = 0; i < (int)query.size(); i++)
		g.pb(mp(mp(query[i].y1, 1), mp(i, -1)));
	sort(g.begin(), g.end());
	int t = -1;
	U = 0;
	for (int i = 0; i < (int)g.size(); i++){
		if (g[i].first.second == 0){
			int cur = new_node(g[i].second.second, g[i].second.first);
			pair<int, int> a = split(t, tree[cur].x);
			t = merg(a.first, cur);
			t = merg(t, a.second);
		}
		if (g[i].first.second == 1){
			int num = g[i].second.first;
			pair<int, int> a = split(t, query[num].x1);
			pair<int, int> b = split(a.second, query[num].x2 + 1);
			if (b.first == -1 || tree[b.first].ma < query[num].y2)
				res[num][tq] = 0;
			else
				res[num][tq] = 1;
			t = merg(a.first, b.first);
			t = merg(t, b.second);
		}
		if (g[i].first.second == 2){
			int cur = g[i].second.second;
			pair<int, int> a = split(t, cur);
			pair<int, int> b = split(a.second, cur + 1);
			t = merg(a.first, b.second);
		}
	}
}

int main(){
	srand(time(NULL));
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m, k, q;
	int x1, x2, y1, y2, x, y;
	scanf("%d%d%d%d", &n, &m, &k, &q);
	vector<pair<int, int> >l;
	vector<que> r;
	for (int i = 0; i < k; i++){
		scanf("%d%d", &x, &y);
		l.pb(mp(x, y));
	}
	for (int i = 0; i < q; i++){
		que que1;
		scanf("%d%d%d%d", &que1.x1, &que1.y1, &que1.x2, &que1.y2);
		r.pb(que1);
	}
	solve(0, l, r, n, m);
	for (int i = 0; i < k; i++){
		x = l[i].first;
		y = l[i].second;
		l[i].first = y;
		l[i].second = n + 1 - x;
	}
	for (int i = 0; i < q; i++){
		x1 = r[i].x1;
		y1 = r[i].y1;
		x2 = r[i].x2;
		y2 = r[i].y2;
		r[i].x1 = y1;
		r[i].y1 = n + 1 - x1;
		r[i].x2 = y2;
		r[i].y2 = n + 1 - x2;
	}
	solve(1, l, r, m, n);
	for (int i = 0; i < q; i++){
		cerr << "res" << " " << i << " " << res[i][0] << " " << res[i][1] << endl;
		if (res[i][0] && res[i][1])
			printf("NO\n");
		else
			printf("YES\n");
		}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <ctime>
#include <cassert>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;

#ifdef WIN32
	#define lld "%I64d"
#else
	#define lld "%lld"
#endif

#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double db;

const int M = 6 * 1e5 + 1050;
const ll Q = 1e18 + 7;

struct node{
	int x, y, l, r, val, ma;
};

struct que{
	int x1, x2, y1, y2;
};

bool res[M][2];
vector<pair<pair<int, int>, pair<int, int> > > g;
node tree[M];
vector<int> qqq[M];
int U;

int new_node(int x, int val){
	tree[U].x = x;
	tree[U].y = rand();
	tree[U].l = tree[U].r = -1;
	tree[U].val = tree[U].ma = val;
	U++;
	return U - 1;
}
int mama(int t){
	if (t == -1)
		return -1;
	return tree[t].ma;
}

void recalc(int t){
	tree[t].ma = max(max(mama(tree[t].l), mama(tree[t].r)), tree[t].val);
}

pair<int, int> split(int t, int x){
	if (t == -1)
		return mp(-1, -1);
	if (tree[t].x >= x){
		pair<int, int> a = split(tree[t].l, x);
		tree[t].l = a.second;
		recalc(t);
		return mp(a.first, t);
	}
	else{
		pair<int, int> a = split(tree[t].r, x);
		tree[t].r = a.first;
		recalc(t);
		return mp(t, a.second);
	}
}

int merg(int l, int r){
	if (l == -1)
		return r;
	if (r == -1)
		return l;
	if (tree[l].y > tree[r].y){
		tree[l].r = merg(tree[l].r, r);
		recalc(l);
		return l;
	}
	else{
		tree[r].l = merg(l, tree[r].l);
		recalc(r);
		return r;
	}
}

void add(int x1, int x2, int i){
	g.pb(mp(mp(x1 + 1, 0), mp(x2 - 1, i)));
	g.pb(mp(mp(x2 - 1, 2), mp(x1 + 1, i)));
	cerr << "^" << i << " " << x1+1 << " " << x2-1 << endl;
}

void solve(int tq, vector<pair<int, int> > &lad, vector<que> query, int n, int m){
	for (int i =0; i < (int)lad.size(); i++)
		cerr << lad[i].first << " " << lad[i].second << endl;
	for (int i = 0; i <= n; i++)
		qqq[i].resize(0);
	for (int i = 0; i < (int)lad.size(); i++)
		qqq[lad[i].first].pb(lad[i].second);
	for (int i = 1; i <= n; i++)
		sort(qqq[i].begin(), qqq[i].end());
	g.resize(0);
	for (int i = 1; i <= n; i++){
		if ((int)qqq[i].size() == 0){
		    add(0, m + 1, i);
			continue;
		}
		for (int j = 0; j < (int)qqq[i].size() - 1; j++)
			add(qqq[i][j], qqq[i][j + 1], i);
		if (qqq[i][0] > 1)
			add(0, qqq[i][0], i);
		if (qqq[i][(int)qqq[i].size() - 1] < m)
			add(qqq[i][(int)qqq[i].size() - 1], m + 1, i);
	}
	for (int i = 0; i < (int)query.size(); i++)
		g.pb(mp(mp(query[i].y1, 1), mp(i, -1)));
	sort(g.begin(), g.end());
	int t = -1;
	U = 0;
	for (int i = 0; i < (int)g.size(); i++){
		cerr << g[i].first.first << " " << g[i].first.second << " " << g[i].second.first << " " << g[i].second.second << endl;

		if (g[i].first.second == 0){
			int cur = new_node(g[i].second.second, g[i].second.first);
			pair<int, int> a = split(t, tree[cur].x);
			t = merg(a.first, cur);
			t = merg(t, a.second);
		}
		if (g[i].first.second == 1){
			cerr << "F" << endl;
			int num = g[i].second.first;
			pair<int, int> a = split(t, query[num].x1);
			pair<int, int> b = split(a.second, query[num].x2 + 1);
			if (b.first == -1 || tree[b.first].ma < query[num].y2)
				res[num][tq] = 0;
			else
				res[num][tq] = 1;
		//	cerr << b.first << endl;

			t = merg(a.first, b.first);
			t = merg(t, b.second);
		}
		if (g[i].first.second == 2){
			int cur = g[i].second.second;
			pair<int, int> a = split(t, cur);
			pair<int, int> b = split(a.second, cur + 1);
			t = merg(a.first, b.second);
		}
	}
}

int main(){
	srand(time(NULL));
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m, k, q;
	int x1, x2, y1, y2, x, y;
	scanf("%d%d%d%d", &n, &m, &k, &q);
	vector<pair<int, int> >l;
	vector<que> r;
	for (int i = 0; i < k; i++){
		scanf("%d%d", &x, &y);
		l.pb(mp(x, y));
	}
	for (int i = 0; i < q; i++){
		que que1;
		scanf("%d%d%d%d", &que1.x1, &que1.y1, &que1.x2, &que1.y2);
		r.pb(que1);
	}
	solve(0, l, r, n, m);
	for (int i = 0; i < k; i++){
		x = l[i].first;
		y = l[i].second;
		l[i].first = y;
		l[i].second = n + 1 - x;
//		cout << l[i].first << " " << l[i].second << endl;
	}
	for (int i = 0; i < q; i++){
		x1 = r[i].x1;
		y1 = r[i].y1;
		x2 = r[i].x2;
		y2 = r[i].y2;
		r[i].x2 = y2;
		r[i].y2 = n + 1 - x1;
		r[i].x1 = y1;
		r[i].y1 = n + 1 - x2;
//		cout << r[i].x1 << " " << r[i].y1 << " " << r[i].x2 << " " << r[i].y2 << endl;
	}
	solve(1, l, r, m, n);
	for (int i = 0; i < q; i++){
		cerr << "res" << " " << i << " " << res[i][0] << " " << res[i][1] << endl;
		if (res[i][0] && res[i][1])
			printf("NO\n");
		else
			printf("YES\n");
		}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <ctime>
#include <cassert>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;

#ifdef WIN32
	#define lld "%I64d"
#else
	#define lld "%lld"
#endif

#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double db;

const int M = 6 * 1e5 + 1050;
const ll Q = 1e18 + 7;

struct node{
	int x, y, l, r, val, ma;
};

struct que{
	int x1, x2, y1, y2;
};

bool res[M][2];
vector<pair<pair<int, int>, pair<int, int> > > g;
node tree[M];
vector<int> qqq[M];
int U;

int new_node(int x, int val){
	tree[U].x = x;
	tree[U].y = rand();
	tree[U].l = tree[U].r = -1;
	tree[U].val = tree[U].ma = val;
	U++;
	return U - 1;
}
int mama(int t){
	if (t == -1)
		return -1;
	return tree[t].ma;
}

void recalc(int t){
	tree[t].ma = max(max(mama(tree[t].l), mama(tree[t].r)), tree[t].val);
}

pair<int, int> split(int t, int x){
	if (t == -1)
		return mp(-1, -1);
	if (tree[t].x >= x){
		pair<int, int> a = split(tree[t].l, x);
		tree[t].l = a.second;
		recalc(t);
		return mp(a.first, t);
	}
	else{
		pair<int, int> a = split(tree[t].r, x);
		tree[t].r = a.first;
		recalc(t);
		return mp(t, a.second);
	}
}

int merg(int l, int r){
	if (l == -1)
		return r;
	if (r == -1)
		return l;
	if (tree[l].y > tree[r].y){
		tree[l].r = merg(tree[l].r, r);
		recalc(l);
		return l;
	}
	else{
		tree[r].l = merg(l, tree[r].l);
		recalc(r);
		return r;
	}
}

void add(int x1, int x2, int i){
	g.pb(mp(mp(x1 + 1, 0), mp(x2 - 1, i)));
	g.pb(mp(mp(x2 - 1, 1), mp(x1 + 1, i)));
}

void solve(int tq, vector<pair<int, int> > &lad, vector<que> query, int n, int m){
	for (int i = 0; i <= n; i++)
		qqq[i].resize(0);
	for (int i = 0; i < (int)lad.size(); i++)
		qqq[lad[i].first].pb(lad[i].second);
	g.resize(0);
	for (int i = 1; i <= n; i++){
		if ((int)qqq[i].size() == 0)
			continue;
		for (int j = 0; j < (int)qqq[i].size() - 1; j++)
			add(qqq[i][j], qqq[i][j + 1], i);
		add(0, qqq[i][0], i);
		add(qqq[i][(int)qqq[i].size() - 1], m + 1, i);
	}
	for (int i = 0; i < (int)query.size(); i++)
		g.pb(mp(mp(query[i].y1, 1), mp(i, -1)));
	sort(g.begin(), g.end());
	int t = -1;
	U = 0;
	for (int i = 0; i < (int)g.size(); i++){
		if (g[i].first.second == 0){
			int cur = new_node(g[i].second.second, g[i].second.first);
			pair<int, int> a = split(t, tree[cur].x);
			t = merg(a.first, cur);
			t = merg(t, a.second);
		}
		if (g[i].first.second == 1){
			int num = g[i].second.first;
			pair<int, int> a = split(t, query[num].x1);
			pair<int, int> b = split(a.second, query[num].x2 + 1);
			if (b.first == -1 || tree[b.first].ma < query[num].y2)
				res[num][tq] = 0;
			else
				res[num][tq] = 1;
			t = merg(a.first, b.first);
			t = merg(t, b.second);
		}
		if (g[i].first.second == 2){
			int cur = g[i].second.second;
			pair<int, int> a = split(t, cur);
			pair<int, int> b = split(a.second, cur + 1);
			t = merg(a.first, b.second);
		}
	}
}

int main(){
	srand(time(NULL));
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m, k, q;
	int x1, x2, y1, y2, x, y;
	scanf("%d%d%d%d", &n, &m, &k, &q);
	vector<pair<int, int> >l;
	vector<que> r;
	for (int i = 0; i < k; i++){
		scanf("%d%d", &x, &y);
		l.pb(mp(x, y));
	}
	for (int i = 0; i < q; i++){
		que que1;
		scanf("%d%d%d%d", &que1.x1, &que1.y1, &que1.x2, &que1.y2);
		r.pb(que1);
	}
	solve(0, l, r, n, m);
	for (int i = 0; i < k; i++){
		x = l[i].first;
		y = l[i].second;
		l[i].first = y;
		l[i].second = n + 1 - x;
	}
	for (int i = 0; i < q; i++){
		x1 = r[i].x1;
		y1 = r[i].y1;
		x2 = r[i].x2;
		y2 = r[i].y2;
		r[i].x1 = y1;
		r[i].y1 = n + 1 - x1;
		r[i].x2 = y2;
		r[i].y2 = n + 1 - x2;
	}
	solve(1, l, r, m, n);
	for (int i = 0; i < q; i++){
		if (res[i][0] && res[i][1])
			printf("NO\n");
		else
			printf("YES\n");
		}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <ctime>
#include <cassert>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;

#ifdef WIN32
	#define lld "%I64d"
#else
	#define lld "%lld"
#endif

#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double db;

const int M = 6 * 1e5 + 1050;
const ll Q = 1e18 + 7;

struct node{
	int x, y, l, r, val, ma;
};

struct que{
	int x1, x2, y1, y2;
};

bool res[M][2];
vector<pair<pair<int, int>, pair<int, int> > > g;
node tree[M];
vector<int> qqq[M];
int U;

int new_node(int x, int val){
	tree[U].x = x;
	tree[U].y = rand();
	tree[U].l = tree[U].r = -1;
	tree[U].val = tree[U].ma = val;
	U++;
	return U - 1;
}
int mama(int t){
	if (t == -1)
		return -1;
	return tree[t].ma;
}

void recalc(int t){
	tree[t].ma = max(max(mama(tree[t].l), mama(tree[t].r)), tree[t].val);
}

pair<int, int> split(int t, int x){
	if (t == -1)
		return mp(-1, -1);
	if (tree[t].x >= x){
		pair<int, int> a = split(tree[t].l, x);
		tree[t].l = a.second;
		recalc(t);
		return mp(a.first, t);
	}
	else{
		pair<int, int> a = split(tree[t].r, x);
		tree[t].r = a.first;
		recalc(t);
		return mp(t, a.second);
	}
}

int merg(int l, int r){
	if (l == -1)
		return r;
	if (r == -1)
		return l;
	if (tree[l].y > tree[r].y){
		tree[l].r = merg(tree[l].r, r);
		recalc(l);
		return l;
	}
	else{
		tree[r].l = merg(l, tree[r].l);
		recalc(r);
		return r;
	}
}

void add(int x1, int x2, int i){
	g.pb(mp(mp(x1 + 1, 0), mp(x2 - 1, i)));
	g.pb(mp(mp(x2 - 1, 2), mp(x1 + 1, i)));
//	cerr << "^" << i << " " << x1+1 << " " << x2-1 << endl;
}

void solve(int tq, vector<pair<int, int> > &lad, vector<que> query, int n, int m){
//	for (int i =0; i < (int)lad.size(); i++)
//		cerr << lad[i].first << " " << lad[i].second << endl;
	for (int i = 0; i <= n; i++)
		qqq[i].resize(0);
	for (int i = 0; i < (int)lad.size(); i++)
		qqq[lad[i].first].pb(lad[i].second);
	for (int i = 1; i <= n; i++)
		sort(qqq[i].begin(), qqq[i].end());
	g.resize(0);
	for (int i = 1; i <= n; i++){
		if ((int)qqq[i].size() == 0){
		    add(0, m + 1, i);
			continue;
		}
		for (int j = 0; j < (int)qqq[i].size() - 1; j++)
			add(qqq[i][j], qqq[i][j + 1], i);
		if (qqq[i][0] > 1)
			add(0, qqq[i][0], i);
		if (qqq[i][(int)qqq[i].size() - 1] < m)
			add(qqq[i][(int)qqq[i].size() - 1], m + 1, i);
	}
	for (int i = 0; i < (int)query.size(); i++)
		g.pb(mp(mp(query[i].y1, 1), mp(i, -1)));
	sort(g.begin(), g.end());
	int t = -1;
	U = 0;
	for (int i = 0; i < (int)g.size(); i++){
	//	cerr << g[i].first.first << " " << g[i].first.second << " " << g[i].second.first << " " << g[i].second.second << endl;

		if (g[i].first.second == 0){
			int cur = new_node(g[i].second.second, g[i].second.first);
			pair<int, int> a = split(t, tree[cur].x);
			t = merg(a.first, cur);
			t = merg(t, a.second);
		}
		if (g[i].first.second == 1){
			//cerr << "F" << endl;
			int num = g[i].second.first;
			pair<int, int> a = split(t, query[num].x1);
			pair<int, int> b = split(a.second, query[num].x2 + 1);
			if (b.first == -1 || tree[b.first].ma < query[num].y2)
				res[num][tq] = 0;
			else
				res[num][tq] = 1;
		//	cerr << b.first << endl;

			t = merg(a.first, b.first);
			t = merg(t, b.second);
		}
		if (g[i].first.second == 2){
			int cur = g[i].second.second;
			pair<int, int> a = split(t, cur);
			pair<int, int> b = split(a.second, cur + 1);
			t = merg(a.first, b.second);
		}
	}
}

int main(){
	srand(time(NULL));
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m, k, q;
	int x1, x2, y1, y2, x, y;
	scanf("%d%d%d%d", &n, &m, &k, &q);
	vector<pair<int, int> >l;
	vector<que> r;
	for (int i = 0; i < k; i++){
		scanf("%d%d", &x, &y);
		l.pb(mp(x, y));
	}
	for (int i = 0; i < q; i++){
		que que1;
		scanf("%d%d%d%d", &que1.x1, &que1.y1, &que1.x2, &que1.y2);
		r.pb(que1);
	}
	solve(0, l, r, n, m);
	for (int i = 0; i < k; i++){
		x = l[i].first;
		y = l[i].second;
		l[i].first = y;
		l[i].second = n + 1 - x;
//		cout << l[i].first << " " << l[i].second << endl;
	}
	for (int i = 0; i < q; i++){
		x1 = r[i].x1;
		y1 = r[i].y1;
		x2 = r[i].x2;
		y2 = r[i].y2;
		r[i].x2 = y2;
		r[i].y2 = n + 1 - x1;
		r[i].x1 = y1;
		r[i].y1 = n + 1 - x2;
//		cout << r[i].x1 << " " << r[i].y1 << " " << r[i].x2 << " " << r[i].y2 << endl;
	}
	solve(1, l, r, m, n);
	for (int i = 0; i < q; i++){
		//cerr << "res" << " " << i << " " << res[i][0] << " " << res[i][1] << endl;
		if (res[i][0] && res[i][1])
			printf("NO\n");
		else
			printf("YES\n");
		}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <ctime>
#include <cassert>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;

#ifdef WIN32
	#define lld "%I64d"
#else
	#define lld "%lld"
#endif

#define mp make_pair
#define pb push_back
#define put(x) { cout << #x << " = "; cout << (x) << endl; }

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef double db;

const int M = 6 * 1e5 + 1050;
const ll Q = 1e18 + 7;

struct node{
	int x, y, l, r, val, ma;
};

struct que{
	int x1, x2, y1, y2;
};

bool res[M][2];
vector<pair<pair<int, int>, pair<int, int> > > g;
node tree[M];
vector<int> qqq[M];
int U;

int new_node(int x, int val){
	tree[U].x = x;
	tree[U].y = rand();
	tree[U].l = tree[U].r = -1;
	tree[U].val = tree[U].ma = val;
	U++;
	return U - 1;
}
int mama(int t){
	if (t == -1)
		return -1;
	return tree[t].ma;
}

void recalc(int t){
	tree[t].ma = max(max(mama(tree[t].l), mama(tree[t].r)), tree[t].val);
}

pair<int, int> split(int t, int x){
	if (t == -1)
		return mp(-1, -1);
	if (tree[t].x >= x){
		pair<int, int> a = split(tree[t].l, x);
		tree[t].l = a.second;
		recalc(t);
		return mp(a.first, t);
	}
	else{
		pair<int, int> a = split(tree[t].r, x);
		tree[t].r = a.first;
		recalc(t);
		return mp(t, a.second);
	}
}

int merg(int l, int r){
	if (l == -1)
		return r;
	if (r == -1)
		return l;
	if (tree[l].y > tree[r].y){
		tree[l].r = merg(tree[l].r, r);
		recalc(l);
		return l;
	}
	else{
		tree[r].l = merg(l, tree[r].l);
		recalc(r);
		return r;
	}
}

void add(int x1, int x2, int i){
	g.pb(mp(mp(x1 + 1, 0), mp(x2 - 1, i)));
	g.pb(mp(mp(x2 - 1, 2), mp(x1 + 1, i)));
	cerr << "^" << i << " " << x1+1 << " " << x2-1 << endl;
}

void solve(int tq, vector<pair<int, int> > &lad, vector<que> query, int n, int m){
	for (int i =0; i < (int)lad.size(); i++)
		cerr << lad[i].first << " " << lad[i].second << endl;
	for (int i = 0; i <= n; i++)
		qqq[i].resize(0);
	for (int i = 0; i < (int)lad.size(); i++)
		qqq[lad[i].first].pb(lad[i].second);
	g.resize(0);
	for (int i = 1; i <= n; i++){
		if ((int)qqq[i].size() == 0){
		    add(0, m + 1, i);
			continue;
		}
		for (int j = 0; j < (int)qqq[i].size() - 1; j++)
			add(qqq[i][j], qqq[i][j + 1], i);
		if (qqq[i][0] > 1)
			add(0, qqq[i][0], i);
		if (qqq[i][(int)qqq[i].size() - 1] < m)
			add(qqq[i][(int)qqq[i].size() - 1], m + 1, i);
	}
	for (int i = 0; i < (int)query.size(); i++)
		g.pb(mp(mp(query[i].y1, 1), mp(i, -1)));
	sort(g.begin(), g.end());
	int t = -1;
	U = 0;
	for (int i = 0; i < (int)g.size(); i++){
		cerr << g[i].first.first << " " << g[i].first.second << " " << g[i].second.first << " " << g[i].second.second << endl;

		if (g[i].first.second == 0){
			int cur = new_node(g[i].second.second, g[i].second.first);
			pair<int, int> a = split(t, tree[cur].x);
			t = merg(a.first, cur);
			t = merg(t, a.second);
		}
		if (g[i].first.second == 1){
			cerr << "F" << endl;
			int num = g[i].second.first;
			pair<int, int> a = split(t, query[num].x1);
			pair<int, int> b = split(a.second, query[num].x2 + 1);
			if (b.first == -1 || tree[b.first].ma < query[num].y2)
				res[num][tq] = 0;
			else
				res[num][tq] = 1;
		//	cerr << b.first << endl;

			t = merg(a.first, b.first);
			t = merg(t, b.second);
		}
		if (g[i].first.second == 2){
			int cur = g[i].second.second;
			pair<int, int> a = split(t, cur);
			pair<int, int> b = split(a.second, cur + 1);
			t = merg(a.first, b.second);
		}
	}
}

int main(){
	srand(time(NULL));
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m, k, q;
	int x1, x2, y1, y2, x, y;
	scanf("%d%d%d%d", &n, &m, &k, &q);
	vector<pair<int, int> >l;
	vector<que> r;
	for (int i = 0; i < k; i++){
		scanf("%d%d", &x, &y);
		l.pb(mp(x, y));
	}
	for (int i = 0; i < q; i++){
		que que1;
		scanf("%d%d%d%d", &que1.x1, &que1.y1, &que1.x2, &que1.y2);
		r.pb(que1);
	}
	solve(0, l, r, n, m);
	for (int i = 0; i < k; i++){
		x = l[i].first;
		y = l[i].second;
		l[i].first = y;
		l[i].second = n + 1 - x;
	}
	for (int i = 0; i < q; i++){
		x1 = r[i].x1;
		y1 = r[i].y1;
		x2 = r[i].x2;
		y2 = r[i].y2;
		r[i].x1 = y1;
		r[i].y1 = n + 1 - x1;
		r[i].x2 = y2;
		r[i].y2 = n + 1 - x2;
	}
	solve(1, l, r, m, n);
	for (int i = 0; i < q; i++){
		cerr << "res" << " " << i << " " << res[i][0] << " " << res[i][1] << endl;
		if (res[i][0] && res[i][1])
			printf("NO\n");
		else
			printf("YES\n");
		}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <complex>
#include <ctime>
#include <iomanip>
#include <cassert>
#include <sstream>
#include <iterator>

using namespace std;

#define file "file"
#define mp make_pair
#define pb push_back
#define xx real()
#define yy imag()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef complex<double> point;

const int MAXN = 1e5 + 5;
const int MAXN2 = 2e5 + 5;
const int INF = 1e9;

int pos[MAXN2][2];
int tt[4 * MAXN];
int qq[MAXN2][4];
pair<pii,int> pt[MAXN2 * 2];
int top,cnt;
int ans[MAXN2];

void update(int v,int tl,int tr,int pos,int val){
    if(tl == tr){
        tt[v] = val;
        return;
    }
    int tm = (tl + tr) >> 1;
    if(pos <= tm){
        update(2 * v + 1,tl,tm,pos,val);
    }
    else{
        update(2 * v + 2,tm + 1,tr,pos,val);
    }
    tt[v] = min(tt[2 * v + 1],tt[2 * v + 2]);
}

int get_min(int v,int tl,int tr,int l,int r){
    if(l > r) return INF;
    if(tl == l && tr == r){
        return tt[v];
    }
    int tm = (tl + tr) >> 1;
    return min(get_min(2 * v + 1,tl,tm,l,min(r,tm)),
               get_min(2 * v + 2,tm + 1,tr,max(l,tm + 1),r));
}

void solve(){
    int n,m,k,q;
    scanf("%d%d%d%d",&n,&m,&k,&q);
    int x,y;
    for(int i = 0;i < k;i++){
        scanf("%d%d",&pos[i][0],&pos[i][1]);
    }
    cnt = 1;
    while(cnt <= m) cnt <<= 1;
    for(int i = 0;i < 2 * cnt;i++){
        tt[i] = -INF;
    }
    for(int i = 0;i < q;i++){
        for(int j = 0;j < 4;j++){
            scanf("%d",&qq[i][j]);
        }
    }
    top = 0;
    for(int i = 0;i < k;i++){
        pt[top++] = mp(mp(pos[i][0],pos[i][1]),-1);
    }
    for(int i = 0;i < q;i++){
        pt[top++] = mp(mp(qq[i][2],qq[i][3]),i);
    }
    sort(pt,pt + top);
    for(int i = 0;i < top;i++){
        int id = pt[i].second;
        if(id == -1){
            update(0,cnt - 1,2 * cnt - 2,cnt - 1 + pt[i].first.second,pt[i].first.first);
        }
        else{
            int cur = get_min(0,cnt - 1,2 * cnt - 2,cnt - 1 + qq[id][1],cnt - 1 + qq[id][3]);
            if(cur < qq[id][0]){
                ans[id]++;
            }
        }
    }
    cnt = 1;
    while(cnt <= n) cnt <<= 1;
    for(int i = 0;i < 2 * cnt;i++){
        tt[i] = -INF;
    }
    top = 0;
    for(int i = 0;i < k;i++){
        pt[top++] = mp(mp(pos[i][1],pos[i][0]),-1);
    }
    for(int i = 0;i < q;i++){
        pt[top++] = mp(mp(qq[i][3],qq[i][2]),i);
    }
    sort(pt,pt + top);
    for(int i = 0;i < top;i++){
        int id = pt[i].second;
        if(id == -1){
            update(0,cnt - 1,2 * cnt - 2,cnt - 1 + pt[i].first.second,pt[i].first.first);
        }
        else{
            int cur = get_min(0,cnt - 1,2 * cnt - 2,cnt - 1 + qq[id][0],cnt - 1 + qq[id][2]);
            if(cur < qq[id][1]){
                ans[id]++;
            }
        }
    }
    for(int i = 0;i < q;i++){
        if(ans[i] == 2) printf("NO\n");
        else printf("YES\n");
    }
}

int main()
{
	#ifndef ONLINE_JUDGE
    assert(freopen("input.txt","r",stdin));
    assert(freopen("output.txt","w",stdout));
    #else
    //assert(freopen(file".in","r",stdin)); assert(freopen(file".out","w",stdout));
    #endif
	int t = 1;
	while(t--){
		solve();
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <complex>
#include <ctime>
#include <iomanip>
#include <cassert>
#include <sstream>
#include <iterator>

using namespace std;

#define file "file"
#define mp make_pair
#define pb push_back
#define xx real()
#define yy imag()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef complex<double> point;

const int MAXN = 1e5 + 5;
const int MAXN2 = 2e5 + 5;
const int INF = 1e9;

int pos[MAXN2][2];
int tt[4 * MAXN];
int qq[MAXN2][4];
pair<pii,int> pt[MAXN2 * 2];
int top,cnt;
int ans[MAXN2];

void build(int n){
    for(int i = n - 2;i >= 0;i--){
        tt[i] = min(tt[2 * i + 1],tt[2 * i + 2]);
    }
}

void update(int v,int tl,int tr,int pos,int val){
    if(tl == tr){
        tt[v] = val;
        return;
    }
    int tm = (tl + tr) >> 1;
    if(pos <= tm){
        update(2 * v + 1,tl,tm,pos,val);
    }
    else{
        update(2 * v + 2,tm + 1,tr,pos,val);
    }
    tt[v] = min(tt[2 * v + 1],tt[2 * v + 2]);
}

int get_min(int v,int tl,int tr,int l,int r){
    if(l > r) return INF;
    if(tl == l && tr == r){
        return tt[v];
    }
    int tm = (tl + tr) >> 1;
    return min(get_min(2 * v + 1,tl,tm,l,min(r,tm)),
               get_min(2 * v + 2,tm + 1,tr,max(l,tm + 1),r));
}

void solve(){
    int n,m,k,q;
    scanf("%d%d%d%d",&n,&m,&k,&q);
    int x,y;
    for(int i = 0;i < k;i++){
        scanf("%d%d",&pos[i][0],&pos[i][1]);
    }
    cnt = 1;
    while(cnt <= n) cnt <<= 1;
    for(int i = 0;i < 2 * cnt;i++){
        tt[i] = -INF;
    }
    for(int i = 0;i < q;i++){
        for(int j = 0;j < 4;j++){
            scanf("%d",&qq[i][j]);
        }
    }
    top = 0;
    for(int i = 0;i < k;i++){
        pt[top++] = mp(mp(pos[i][0],pos[i][1]),-1);
    }
    for(int i = 0;i < q;i++){
        pt[top++] = mp(mp(qq[i][2],qq[i][3]),i);
    }
    sort(pt,pt + top);
    for(int i = 0;i < top;i++){
        int id = pt[i].second;
        if(id == -1){
            update(0,cnt - 1,2 * cnt - 2,cnt - 1 + pt[i].first.second,pt[i].first.first);
        }
        else{
            int cur = get_min(0,cnt - 1,2 * cnt - 2,cnt - 1 + qq[id][1],cnt - 1 + qq[id][3]);
            if(cur < qq[id][0]){
                ans[id]++;
            }
        }
    }
    cnt = 1;
    while(cnt <= m) cnt <<= 1;
    for(int i = 0;i < 2 * cnt;i++){
        tt[i] = -INF;
    }
    top = 0;
    for(int i = 0;i < k;i++){
        pt[top++] = mp(mp(pos[i][1],pos[i][0]),-1);
    }
    for(int i = 0;i < q;i++){
        pt[top++] = mp(mp(qq[i][3],qq[i][2]),i);
    }
    sort(pt,pt + top);
    for(int i = 0;i < top;i++){
        int id = pt[i].second;
        if(id == -1){
            update(0,cnt - 1,2 * cnt - 2,cnt - 1 + pt[i].first.second,pt[i].first.first);
        }
        else{
            int cur = get_min(0,cnt - 1,2 * cnt - 2,cnt - 1 + qq[id][0],cnt - 1 + qq[id][2]);
            if(cur < qq[id][1]){
                ans[id]++;
            }
        }
    }
    for(int i = 0;i < q;i++){
        if(ans[i] == 2) printf("NO\n");
        else printf("YES\n");
    }
}

int main()
{
	#ifndef ONLINE_JUDGE
    assert(freopen("input.txt","r",stdin));
    assert(freopen("output.txt","w",stdout));
    #else
    //assert(freopen(file".in","r",stdin)); assert(freopen(file".out","w",stdout));
    #endif
	int t = 1;
	while(t--){
		solve();
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <complex>
#include <ctime>
#include <iomanip>
#include <cassert>
#include <sstream>
#include <iterator>

using namespace std;

#define file "file"
#define mp make_pair
#define pb push_back
#define xx real()
#define yy imag()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef complex<double> point;

const int MAXN = 1e5 + 5;
const int MAXN2 = 2e5 + 5;
const int INF = 1e9;

int pos[MAXN2][2];
int tt[4 * MAXN];
int qq[MAXN2][4];
pair<pii,int> pt[MAXN2 * 2];
int top,cnt;
int ans[MAXN2];

void build(int n){
    for(int i = n - 2;i >= 0;i--){
        tt[i] = min(tt[2 * i + 1],tt[2 * i + 2]);
    }
}

void update(int v,int tl,int tr,int pos,int val){
    if(tl == tr){
        tt[v] = val;
        return;
    }
    int tm = (tl + tr) >> 1;
    if(pos <= tm){
        update(2 * v + 1,tl,tm,pos,val);
    }
    else{
        update(2 * v + 2,tm + 1,tr,pos,val);
    }
    tt[v] = min(tt[2 * v + 1],tt[2 * v + 2]);
}

int get_min(int v,int tl,int tr,int l,int r){
    if(l > r) return INF;
    if(tl == l && tr == r){
        return tt[v];
    }
    int tm = (tl + tr) >> 1;
    return min(get_min(2 * v + 1,tl,tm,l,min(r,tm)),
               get_min(2 * v + 2,tm + 1,tr,max(l,tm + 1),r));
}

void solve(){
    int n,m,k,q;
    scanf("%d%d%d%d",&n,&m,&k,&q);
    int x,y;
    for(int i = 0;i < k;i++){
        scanf("%d%d",&pos[i][0],&pos[i][1]);
    }
    cnt = 1;
    while(cnt <= n) cnt <<= 1;
    for(int i = 0;i < 2 * cnt;i++){
        tt[i] = -INF;
    }
    for(int i = 0;i < q;i++){
        for(int j = 0;j < 4;j++){
            scanf("%d",&qq[i][j]);
        }
    }
    top = 0;
    for(int i = 0;i < k;i++){
        pt[top++] = mp(mp(pos[i][0],pos[i][1]),-1);
    }
    for(int i = 0;i < q;i++){
        pt[top++] = mp(mp(qq[i][2],qq[i][3]),i);
    }
    sort(pt,pt + top);
    for(int i = 0;i < top;i++){
        int id = pt[i].second;
        if(id == -1){
            update(0,cnt - 1,2 * cnt - 2,cnt - 1 + pt[i].first.second,pt[i].first.first);
        }
        else{
            int cur = get_min(0,cnt - 1,2 * cnt - 2,cnt - 1 + qq[id][1],cnt - 1 + qq[id][3]);
            if(cur < qq[id][0]){
                ans[id]++;
            }
        }
    }
    cnt = 1;
    while(cnt <= m) cnt <<= 1;
    for(int i = 0;i < 2 * cnt;i++){
        tt[i] = -INF;
    }
    top = 0;
    for(int i = 0;i < k;i++){
        pt[top++] = mp(mp(pos[i][1],pos[i][0]),-1);
    }
    for(int i = 0;i < q;i++){
        pt[top++] = mp(mp(qq[i][3],qq[i][2]),i);
    }
    sort(pt,pt + top);
    for(int i = 0;i < top;i++){
        int id = pt[i].second;
        if(id == -1){
            update(0,cnt - 1,2 * cnt - 2,cnt - 1 + pt[i].first.second,pt[i].first.first);
        }
        else{
            int cur = get_min(0,cnt - 1,2 * cnt - 2,cnt - 1 + qq[id][0],cnt - 1 + qq[id][2]);
            if(cur < qq[id][1]){
                ans[id]++;
            }
        }
    }
    for(int i = 0;i < k;i++){
        if(ans[i] == 2) printf("NO\n");
        else printf("YES\n");
    }
}

int main()
{
	#ifndef ONLINE_JUDGE
    assert(freopen("input.txt","r",stdin));
    assert(freopen("output.txt","w",stdout));
    #else
    //assert(freopen(file".in","r",stdin)); assert(freopen(file".out","w",stdout));
    #endif
	int t = 1;
	while(t--){
		solve();
	}
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int n,m,k,cq;
struct P{
	int x,y;
}p[200000];
struct Q{
	int x1,y1,x2,y2;
	int id;
}q[200000];
bool yes[200000];
struct L{
	int fr,to,mx;
	L *lc,*rc;
}*root,*li,lines[200000];
L* newL(int fr,int to){
	li->fr=fr;li->to=to;
	li->lc=li->rc=NULL;
	li->mx=0;
	return li++;
}
void build(L*r){
	if(r->fr==r->to)return;
	int mid=(r->fr+r->to)/2;
	r->lc=newL(r->fr,mid);
	r->rc=newL(mid+1,r->to);
	build(r->lc);
	build(r->rc);
}
void _set(L*r,int ps,int v){
	if(r->fr==r->to){
		r->mx=v;
		return;
	}
	int mid=(r->fr+r->to)/2;
	if(ps<=mid)_set(r->lc,ps,v);
	else _set(r->rc,ps,v);
	r->mx=min(r->lc->mx,r->rc->mx);
}
int _get(L*r,int fr,int to){
	if(r->fr==fr&&r->to==to)return r->mx;
	int mid=(r->fr+r->to)/2;
	if(to<=mid)return _get(r->lc,fr,to);
	else if(fr>mid)return _get(r->rc,fr,to);
	else return min(_get(r->lc,fr,mid),_get(r->rc,mid+1,to));
}
bool cmp(P a,P b){
	return a.x<b.x;
}
bool cmp1(Q a,Q b){
	return a.x2<b.x2;
}
void solve(){
	sort(p,p+k,cmp);
	sort(q,q+cq,cmp1);
	li=lines;
	root=newL(1,m);
	build(root);
	for(int i=0,j=0;i<cq;i++){
		while(j<k&&p[j].x<=q[i].x2){
			_set(root,p[j].y,p[j].x);
			j++;
		}
		if(_get(root,q[i].y1,q[i].y2)>=q[i].x1)yes[q[i].id]=true;
	}
}
int main(){
	while(scanf("%d%d%d%d",&n,&m,&k,&cq)==4){
		for(int i=0;i<k;i++)
			scanf("%d%d",&p[i].x,&p[i].y);
		for(int i=0;i<cq;i++){
			scanf("%d%d%d%d",&q[i].x1,&q[i].y1,&q[i].x2,&q[i].y2);
			q[i].id=i;
		}
		memset(yes,false,sizeof(yes));
		solve();
		swap(n,m);
		for(int i=0;i<k;i++)
			swap(p[i].x,p[i].y);
		for(int i=0;i<cq;i++){
			swap(q[i].x1,q[i].y1);
			swap(q[i].x2,q[i].y2);
		}
		solve();
		for(int i=0;i<cq;i++)
			printf("%s\n",yes[i]?"YES":"NO");
	}
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int n,m,k,cq;
struct P{
	int x,y;
}p[200000];
struct Q{
	int x1,y1,x2,y2;
	int id;
}q[200000];
bool yes[200000];
struct L{
	int fr,to,mx;
	L *lc,*rc;
}*root,*li,lines[200000];
L* newL(int fr,int to){
	li->fr=fr;li->to=to;
	li->lc=li->rc=NULL;
	li->mx=0;
	return li++;
}
void build(L*r){
	if(r->fr==r->to)return;
	int mid=(r->fr+r->to)/2;
	r->lc=newL(r->fr,mid);
	r->rc=newL(mid+1,r->to);
	build(r->lc);
	build(r->rc);
}
void _set(L*r,int ps,int v){
	if(r->fr==r->to){
		r->mx=v;
		return;
	}
	int mid=(r->fr+r->to)/2;
	if(ps<=mid)_set(r->lc,ps,v);
	else _set(r->rc,ps,v);
	r->mx=min(r->lc->mx,r->rc->mx);
}
int _get(L*r,int fr,int to){
	if(r->fr==fr&&r->to==to)return r->mx;
	int mid=(r->fr+r->to)/2;
	if(to<=mid)return _get(r->lc,fr,to);
	else if(fr>mid)return _get(r->rc,fr,to);
	else return min(_get(r->lc,fr,mid),_get(r->rc,mid+1,to));
}
bool cmp(P a,P b){
	return a.x<b.x;
}
bool cmp1(Q a,Q b){
	return a.x2<b.x2;
}
void solve(){
	sort(p,p+k,cmp);
	sort(q,q+cq,cmp1);
	li=lines;
	root=newL(1,m);
	build(root);
	for(int i=0,j=0;i<cq;i++){
		while(j<k&&p[j].x<=q[i].x2){
			_set(root,p[j].y,p[j].x);
			j++;
		}
		if(_get(root,q[i].y1,q[i].y2)>=q[i].x1)yes[q[i].id]=true;
	}
}
int main(){
	while(scanf("%d%d%d%d",&n,&m,&k,&cq)==4){
		for(int i=0;i<k;i++)
			scanf("%d%d",&p[i].x,&p[i].y);
		for(int i=0;i<cq;i++){
			scanf("%d%d%d%d",&q[i].x1,&q[i].y1,&q[i].x2,&q[i].y2);
			q[i].id=i;
		}
		memset(yes,false,sizeof(yes));
		solve();
		swap(n,m);
		for(int i=0;i<k;i++)
			swap(p[i].x,p[i].y);
		for(int i=0;i<cq;i++){
			swap(q[i].x1,q[i].y1);
			swap(q[i].x2,q[i].y2);
		}
		solve();
		for(int i=0;i<cq;i++)
			printf("%s\n",yes[i]?"YES":"NO");
	}
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxq = 200001, maxs = 262144;
int n, m, k, q, seg[maxs];
bool ans[maxq];
struct Point
{
	int x, y;
	bool operator < (const Point &t) const
	{
		return x < t.x;
	}
} rook[maxq];
struct Query
{
	int id, x1, y1, x2, y2;
	bool operator < (const Query &t) const
	{
		return x2 < t.x2;
	}
} query[maxq];
void upd(int o, int L, int R, int x, int val)
{
	if(L == R)
	{
		seg[o] = val;
		return;
	}
	int M = L + R >> 1;
	if(x <= M)
		upd(o + o, L, M, x, val);
	else
		upd(o + o + 1, M + 1, R, x, val);
	seg[o] = min(seg[o + o], seg[o + o + 1]);
}
int que(int o, int L, int R, int l, int r)
{
	if(l <= L && R <= r)
		return seg[o];
	int M = L + R >> 1;
	if(r <= M)
		return que(o + o, L, M, l, r);
	else if(l > M)
		return que(o + o + 1, M + 1, R, l, r);
	else
		return min(que(o + o, L, M, l, r), que(o + o + 1, M + 1, R, l, r));
}
int main()
{
	scanf("%d%d%d%d", &n, &m, &k, &q);
	for(int i = 0; i < k; ++i)
		scanf("%d%d", &rook[i].x, &rook[i].y);
	sort(rook, rook + k);
	for(int i = 0; i < q; ++i)
	{
		query[i].id = i;
		scanf("%d%d%d%d", &query[i].x1, &query[i].y1, &query[i].x2, &query[i].y2);
	}
	sort(query, query + q);
	for(int i = 0, j = 0; i < q; ++i)
	{
		while(j < k && rook[j].x <= query[i].x2)
		{
			upd(1, 1, m, rook[j].y, rook[j].x);
			++j;
		}
		ans[query[i].id] |= que(1, 1, m, query[i].y1, query[i].y2) >= query[i].x1;
	}
	memset(seg, 0, sizeof seg);
	swap(n, m);
	for(int i = 0; i < k; ++i)
		swap(rook[i].x, rook[i].y);
	sort(rook, rook + k);
	for(int i = 0; i < q; ++i)
	{
		swap(query[i].x1, query[i].y1);
		swap(query[i].x2, query[i].y2);
	}
	sort(query, query + q);
	for(int i = 0, j = 0; i < q; ++i)
	{
		while(j < k && rook[j].x <= query[i].x2)
		{
			upd(1, 1, m, rook[j].y, rook[j].x);
			++j;
		}
		ans[query[i].id] |= que(1, 1, m, query[i].y1, query[i].y2) >= query[i].x1;
	}
	for(int i = 0; i < q; ++i)
		puts(ans[i] ? "YES" : "NO");
	return 0;
}