#include <iostream>
using namespace std;
#pragma warning (disable: 4996)

const int MAX_N = 3000000;
const int MAX_Z = 17;

struct Coordinate {
	int k1, k2, k3, k4;
};

class SegmentTree {
public:
	int sz = 1;
	int val[MAX_N];
	int chil[MAX_N][16];

	void init() {
		for (int i = 0; i < MAX_N; i++) {
			val[i] = 0;
			for (int j = 0; j < 16; j++) chil[i][j] = -1;
		}
	}

	void build(Coordinate t) {
		Coordinate cl = { 0, 0, 0, 0 };
		Coordinate cr = { (1 << MAX_Z), (1 << MAX_Z), (1 << MAX_Z), (1 << MAX_Z) };

		int cx = 0;
		for (int i = MAX_Z - 1; i >= 0; i--) {
			val[cx]++;

			Coordinate cm;
			cm.k1 = (cl.k1 + cr.k1) / 2;
			cm.k2 = (cl.k2 + cr.k2) / 2;
			cm.k3 = (cl.k3 + cr.k3) / 2;
			cm.k4 = (cl.k4 + cr.k4) / 2;

			int v = 0;
			if (t.k1 >= cm.k1) { v += 1; cl.k1 = cm.k1; } else cr.k1 = cm.k1;
			if (t.k2 >= cm.k2) { v += 2; cl.k2 = cm.k2; } else cr.k2 = cm.k2;
			if (t.k3 >= cm.k3) { v += 4; cl.k3 = cm.k3; } else cr.k3 = cm.k3;
			if (t.k4 >= cm.k4) { v += 8; cl.k4 = cm.k4; } else cr.k4 = cm.k4;

			if (chil[cx][v] == -1) { chil[cx][v] = sz; sz++; }
			cx = chil[cx][v];
		}
		val[cx]++;
	}

	int getans_(Coordinate l, Coordinate r, Coordinate a, Coordinate b, int u) {
		if (r.k1 < a.k1 || b.k1 < l.k1) return 0;
		if (r.k2 < a.k2 || b.k2 < l.k2) return 0;
		if (r.k3 < a.k3 || b.k3 < l.k3) return 0;
		if (r.k4 < a.k4 || b.k4 < l.k4) return 0;

		int cntv = 0;
		if (l.k1 <= a.k1 && b.k1 <= r.k1) cntv++;
		if (l.k2 <= a.k2 && b.k2 <= r.k2) cntv++;
		if (l.k3 <= a.k3 && b.k3 <= r.k3) cntv++;
		if (l.k4 <= a.k4 && b.k4 <= r.k4) cntv++;
		if (cntv == 4) return 1;

		for (int t = 0; t < 16; t++) {
			if (chil[u][t] == -1) continue;

			Coordinate ca, cb;
			if ((t / 1) % 2 == 0) { ca.k1 = a.k1; cb.k1 = ((a.k1 + b.k1) >> 1); }
			else { ca.k1 = ((a.k1 + b.k1) >> 1); cb.k1 = b.k1; }
			if ((t / 2) % 2 == 0) { ca.k2 = a.k2; cb.k2 = ((a.k2 + b.k2) >> 1); }
			else { ca.k2 = ((a.k2 + b.k2) >> 1); cb.k2 = b.k2; }
			if ((t / 4) % 2 == 0) { ca.k3 = a.k3; cb.k3 = ((a.k3 + b.k3) >> 1); }
			else { ca.k3 = ((a.k3 + b.k3) >> 1); cb.k3 = b.k3; }
			if ((t / 8) % 2 == 0) { ca.k4 = a.k4; cb.k4 = ((a.k4 + b.k4) >> 1); }
			else { ca.k4 = ((a.k4 + b.k4) >> 1); cb.k4 = b.k4; }

			int D = getans_(l, r, ca, cb, chil[u][t]);
			if (D == 1) return 1;
		}
		return 0;
	}
	int getans(Coordinate l, Coordinate r) {
		return getans_(l, r, Coordinate{ 0, 0, 0, 0 }, Coordinate{ (1 << MAX_Z), (1 << MAX_Z), (1 << MAX_Z), (1 << MAX_Z) }, 0);
	}
};

int N, A[1 << 18], B[1 << 18], C[1 << 18], D[1 << 18];
int Q, X[1 << 18], Y[1 << 18], Z[1 << 18], W[1 << 18];
SegmentTree V;

int main() {
	scanf("%d%d", &N, &Q);
	for (int i = 1; i <= N; i++) scanf("%d%d%d%d", &A[i], &B[i], &C[i], &D[i]);
	for (int i = 1; i <= Q; i++) scanf("%d%d%d%d", &X[i], &Y[i], &Z[i], &W[i]);

	V.init();
	for (int i = 1; i <= N; i++) {
		Coordinate Z1;
		Z1.k1 = A[i]; Z1.k2 = B[i];
		Z1.k3 = C[i]; Z1.k4 = D[i];
		V.build(Z1);
	}
	for (int i = 1; i <= Q; i++) {
		Coordinate Z1, Z2;
		Z1.k1 = X[i] + 1; Z1.k2 = Y[i] + 1; Z1.k3 = Z[i] + 1; Z1.k4 = W[i] + 1;
		Z2.k1 = Y[i]; Z2.k2 = (1 << MAX_Z); Z2.k3 = W[i]; Z2.k4 = (1 << MAX_Z);

		int E = V.getans(Z1, Z2);
		if (E == 1) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}


Measured memory_bytes: 205528