#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i=(j);i<=(k);i++) 
#define per(i,j,k) for(int i=(j);i>=(k);i--) 
const int N=114514;
int n,m,k[N],al[N],ar[N],bl[N],br[N];
int zl[N],zr[N],yl[N],yr[N];
int main(){scanf("%d%d",&n,&m);
	zr[n+1]=yr[n+1]=m;
	rep(i,1,n)scanf("%d%d%d%d%d",&k[i],&al[i],&bl[i],&ar[i],&br[i]);
	per(i,n,1){if(k[i]>=al[i]&&k[i]<=bl[i]){
			zl[i]=ar[i],zr[i]=br[i];
			if(yl[i+1]>k[i]||yr[i+1]<k[i])zl[i]=max(zl[i],zl[i+1]),zr[i]=min(zr[i],zr[i+1]);
		}else zl[i]=m+1,zr[i]=-1;
		if(k[i]>=ar[i]&&k[i]<=br[i]){
			yl[i]=al[i],yr[i]=bl[i];
			if(zl[i+1]>k[i]||zr[i+1]<k[i])yl[i]=max(yl[i],yl[i+1]),yr[i]=min(yr[i],yr[i+1]);
		}else yl[i]=m+1,yr[i]=-1;
	}int ls=0,rs=0;
	if(zl[1]>0&&yl[1]>0)puts("No"),exit(0);puts("Yes");
	rep(i,1,n){
		if(zl[i]<=ls&&ls<=zr[i])rs=k[i],printf("0 ");
		else ls=k[i],printf("1 ");	
	}
} 