#include <bits/stdc++.h>
using namespace std;

# define Rep(i,a,b) for(int i=a;i<=b;i++)
# define _Rep(i,a,b) for(int i=a;i>=b;i--)
# define RepG(i,u) for(int i=head[u];~i;i=e[i].next)

typedef long long ll;

const int N=1e5+5;

template<typename T> void read(T &x){
   x=0;int f=1;
   char c=getchar();
   for(;!isdigit(c);c=getchar())if(c=='-')f=-1;
   for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+c-'0';
    x*=f;
}

int n,m;
int a[N];
int l[N][2],r[N][2];
int sum[N][2];
bool f[N][2];
int g[N][2];
int ans[N];

int main()
{
	read(n),read(m);
	Rep(i,1,n){
		read(a[i]);
		read(l[i][0]),read(r[i][0]);
		read(l[i][1]),read(r[i][1]);
	}
	Rep(i,1,n)
		Rep(op,0,1)
			sum[i][op]=sum[i-1][op]+(a[i]>=l[i][op]&&a[i]<=r[i][op]);
	int j1=n,j2=n;
	int maxl[2],minr[2];
	maxl[0]=l[n][0],maxl[1]=l[n][1];
	minr[0]=r[n][0],minr[1]=r[n][1];
	_Rep(i,n-1,0){
		Rep(op,0,1){
			maxl[op]=max(maxl[op],l[i][op]);
			minr[op]=min(minr[op],r[i][op]);	
		}
		f[i][0]=(a[i]>=maxl[0]&&a[i]<=minr[0])&&(sum[j2][1]-sum[i][1]==j2-i);
		f[i][1]=(a[i]>=maxl[1]&&a[i]<=minr[1])&&(sum[j1][0]-sum[i][0]==j1-i);
//		printf("!!!%d %d\n",maxl[1],minr[1]);
		int tmp1=j1,tmp2=j2;
		if(f[i][0])g[i][0]=tmp2,j1=i,maxl[1]=l[i][1],minr[1]=r[i][1];
		if(f[i][1])g[i][1]=tmp1,j2=i,maxl[0]=l[i][0],minr[0]=r[i][0];
//		printf("???%d %d\n",maxl[1],minr[1]);
	}
//	Rep(i,0,n)printf("%d ",g[i][0]);
//	puts("");
//	Rep(i,0,n)printf("%d ",g[i][1]);
//	puts("");
	int now=0,op;
	if(!f[0][0]&&!f[0][1])return puts("No"),0;
	puts("Yes");
	if(f[n][0])op=0;
	else op=1;
	while(now<n){
		Rep(i,now+1,g[now][op])ans[i]=op^1;
		now=g[now][op],op^=1;
	}
	Rep(i,1,n)printf("%d ",ans[i]);
	puts("");
	return 0;
}
