//  IPSC 2004, P=NP?
//  (c) David Pal

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define MAX 10001
#define eps 1e-1

int x[MAX], y[MAX];
int N,M;

void swap(int *a, int *b)
{
	int p = *a;
	*a = *b;
	*b = p;
}

// dot product of vectors
double dot(double x1, double y1, double x2, double y2)
{
	return x1*x2 + y1*y2;
}

// cross product of vectors
double cross(double x1, double y1, double x2, double y2)
{
	return x1*y2 - x2*y1;
}

// determine whether the point lies inside NP
int inside(double xx, double yy)
{
	double angle = 0.0;
	int i;

	for(i=0; i<N; i++)
	{
		angle += atan2(cross(x[i]-xx, y[i]-yy, x[i+1]-xx, y[i+1]-yy), dot(x[i]-xx, y[i]-yy, x[i+1]-xx, y[i+1]-yy));
	}
	
	return fabs(fabs(angle)-2*M_PI)<eps;
}

int min(int x, int y)
{
	if(x<y) return x; 
	else return y;
}

int max(int x, int y)
{
	if(x>y) return x;
	else return y;
}

// Does two axis-parallel line-segments intersect?
int sides(int x1, int y1, int x2, int y2, 
		int xx1, int yy1, int xx2, int yy2)
{
	if(x1>x2) swap(&x1, &x2);
	if(y1>y2) swap(&y1, &y2);
	if(xx1>xx2) swap(&xx1, &xx2);
	if(yy1>yy2) swap(&yy1, &yy2);
	
	if(xx1==xx2)
	{
		if(x1==x2) return 0;
		if(x2<xx1) return 0;
		if(x1>xx1) return 0;
		if(y1>yy2) return 0;
		if(y1<yy1) return 0;
			
	}
	else if(yy1==yy2)
	{
		if(y1==y2) return 0;
		if(y2<yy1) return 0;
		if(y1>yy1) return 0;
		if(x1>xx2) return 0;
		if(x1<xx1) return 0;
	}
	else
	{
		fprintf(stderr, "Internal error\n");
		exit(2);
	}

	return 1;
}

int main()
{
	while(1)
	{
		int i,j,area1=0, area2=0,ok;

		if(scanf("%d %d", &N, &M)!=2) break;
		if(N==0 && M==0) break;
		// printf("%d %d  ", N, M);

		// read coordinates of the vertices of the NP 
		for(i=0; i<N; i++) scanf("%d %d", &x[i], &y[i]);			
		x[N]=x[0]; y[N]=y[0];

		// compute (twice) the area of the NP 
		area1 = 0;
		for(i=0; i<N; i++) area1 += (x[i+1]-x[i])*(y[i]+y[i+1]);

		// check whether all edges of the NP are axis-parallel
		ok = 1;
		for(i=0; i<N; i++)
		{
			if(x[i+1]!=x[i] && y[i+1]!=y[i])
			{
				ok = 0; 
				break;
			}
		}

		if(ok)
		{
			// read the rectangles and compute sum of the area of
			// those rectangles which lie inside of the NP 
			area2 = 0;
			for(i=0; i<M; i++) 
			{
				int x1,y1,x2,y2,in;	

				scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
				if(x1>x2) swap(&x1, &x2);
				if(y1>y2) swap(&y1, &y2);
		
				// check whether the rectangle does not intersect the
				// borders of NP
				for(j=0; j<N; j++)
				{
					in = !(
					sides(2*x[j],2*y[j],2*x[j+1],2*y[j+1], 2*x1+1, 2*y1+1, 2*x2-1, 2*y1+1) ||
					sides(2*x[j],2*y[j],2*x[j+1],2*y[j+1], 2*x1+1, 2*y1+1, 2*x1+1, 2*y2-1) ||
					sides(2*x[j],2*y[j],2*x[j+1],2*y[j+1], 2*x2-1, 2*y2-1, 2*x2-1, 2*y1+1) ||
					sides(2*x[j],2*y[j],2*x[j+1],2*y[j+1], 2*x2-1, 2*y2-1, 2*x1+1, 2*y2-1)
					);
				}

				// check if all four its cornes lie inside of
				// the NP
				if(!inside((x1+x2)/2.0, (y1+y2)/2.0))
				{
					in = 0;
				}

				if(in) area2 +=(x2-x1)*(y2-y1);
			}	
		}
		else
		{			
			// read the rest
			for(i=0; i<4*M; i++) scanf("%d", &j);
		}

		// check whether the areas are equal
		if((abs(area1)==2*area2) && ok)
			printf("Yes\n");
		else
			printf("No\n");
	}

	return 0;
}
