#include<bits/stdc++.h>
using namespace std;
# define ll long long
# define read read1<ll>()
# define Type template<typename T>
Type T read1(){
	T t=0;
	char k;
	bool vis=0;
	do (k=getchar())=='-'&&(vis=1);while('0'>k||k>'9');
	while('0'<=k&&k<='9')t=(t<<3)+(t<<1)+(k^'0'),k=getchar();
	return vis?-t:t;
}
# define fre(k) freopen(k".in","r",stdin);freopen(k".out","w",stdout)
struct A{
	int l,r,v;
	A(int _l=1,int _r=0,int _v=0){l=_l;r=_r;v=_v;}
	A operator &(const A &b){return A(max(l,b.l),min(r,b.r),v&b.v);}
}sl[100005][20],sr[100005][20];
int s,k[100005],la[100005][2];
pair<int,int>a[100005],b[100005];
void pr(int n,bool p){
	if(n==1)return;
	pr(la[n][p],p^1);
	for(int i=la[n][p];i<n;++i)
		putchar(p^'1'),putchar(' ');
}
int main(){
	s=read;read;
	for(int i=1;i<=s;++i){
		k[i]=read;
		a[i].first=read;
		a[i].second=read;
		b[i].first=read;
		b[i].second=read;
		sr[i][0]=A(a[i].first,a[i].second,b[i].first<=k[i]&&k[i]<=b[i].second);
		sl[i][0]=A(b[i].first,b[i].second,a[i].first<=k[i]&&k[i]<=a[i].second);
	}for(int i=s;i;--i)
		for(int j=0;i+(1<<j+1)-1<=s;++j){
			sl[i][j+1]=sl[i][j]&sl[i+(1<<j)][j];
			sr[i][j+1]=sr[i][j]&sr[i+(1<<j)][j];
		}
	int xl=1,xr=1;
	for(int i=1;i<=s;++i){
		int tv=xr;
		if(xl>=i&&a[i].first<=k[i]&&k[i]<=a[i].second&&b[i].first<=k[i-1]&&k[i-1]<=b[i].second){
			int j=i;
			for(int x=17;x--;)
				if(sl[j][x].v&&sl[j][x].l<=k[i-1]&&k[i-1]<=sl[j][x].r)
					j+=1<<x;
			while(xr<j)la[++xr][1]=i;
		}
		if(tv>=i&&b[i].first<=k[i]&&k[i]<=b[i].second&&a[i].first<=k[i-1]&&k[i-1]<=a[i].second){
			int j=i;
			for(int x=17;x--;)
				if(sr[j][x].v&&sr[j][x].l<=k[i-1]&&k[i-1]<=sr[j][x].r)
					j+=1<<x;
			while(xl<j)la[++xl][0]=i;
		}
	}
	if(xl<=s&&xr<=s)return puts("No"),0;
	puts("Yes");
	if(xl>s)pr(s+1,0);
	else pr(s+1,1);
	return 0;
}