//CLOCKS_PER_SEC
using namespace std;
#include<bits/stdc++.h>
#define sqr(x) 1ll*(x)*(x)
//#define sort stable_sort
#define ll long long
#define mk make_pair
#define pb push_back
#define in insert
#define mtr(x,y,z) mk(mk(x,y),z)
#define fi first
#define se second
#define lch(x) ((x)<<1)
#define rch(x) (((x)<<1)|1)
#define all(x) (x).begin(),(x).end()
#define titose CLOCKS_PER_SEC
#define fpi(x) freopen(x,"r",stdin);
#define fpo(x) freopen(x,"w",stdout);
#define fprio fpi("in.txt");fpo("out.txt");
#define fast ios_base::sync_with_stdio(false);
inline void read(int &x){int v=0,f=1;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void read(ll &x){ll v=0ll,f=1ll;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void readc(char &x){char c;while (((c=getchar())==' ')||c=='\n');x=c;}
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vl vector<ll>
#define si set<int>
//#define sl set<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define msi map<string,int>
#define msl map<string,ll>
#define piii pair<int,pii >
#define piipi pair<pii,int>
#define plll pair<ll,pll >
#define pllpl pair<pll,ll>
#define pqi priority_queue<int>
#define pql priority_queue<ll>
#define npqi priority_queue<int,vector<int>,greater<int> >
#define npql priority_queue<ll,vector<ll>,greater<ll> >
#define forup(i,a,b) for ((i)=(a);(i)<=(b);(i)++)
#define fordo(i,a,b) for ((i)=(a);(i)>=(b);(i)--)
#define rep(i,x) forup ((i),1,(x))
#define repd(i,x) fordo ((i),(x),1)
#define rep0(i,x) forup ((i),0,((int)(x))-1)
#define rep0d(i,x) fordo ((i),((int)(x))-1,0)
#define itr iterator
#define fe(itcalc,c) for(__typeof((c).begin()) itcalc=(c).begin();itcalc!=(c).end();itcalc++)
#define NO {cout<<"NO";return 0;}
#define YES {cout<<"YES";return 0;}
#define y0 y000000000000000000000000000
#define y1 y111111111111111111111111111
#define j0 j000000000000000000000000000
#define j1 j111111111111111111111111111
#define cl0(a) memset((a),(0),(sizeof((a))))
#define clz(a) memset((a),(0x16),(sizeof((a))))
#define clf(a) memset((a),(-(0x16)),(sizeof((a))))
#define inf 0x3bbbbbbb
#define lnf 0x2bbbbbbbbbbbbbbbll
//#define sqrt divi
#define p2(i) (1ll<<(i))
#define readi read
#define readll read
/*************************************************/
int n,m,i,j,l1[100005],r1[100005],l2[100005],r2[100005],fl[100005],fr[100005],gl[100005],gr[100005],v[100005];
int main()
{
	read(n);read(m);
	rep(i,n){
		read(v[i]);
		read(l1[i]);read(r1[i]);
		read(l2[i]);read(r2[i]);
	}
	fl[n+1]=0;fr[n+1]=m;
	gl[n+1]=0;gr[n+1]=m;
	repd(i,n){
		if(l1[i]<=v[i]&&v[i]<=r1[i]){
			fl[i]=l2[i];fr[i]=r2[i];
			if(!(gl[i+1]<=v[i]&&v[i]<=gr[i+1])){
				fl[i]=max(fl[i],fl[i+1]);
				fr[i]=min(fr[i],fr[i+1]);
			}
		}
		else{
			fl[i]=m;fr[i]=0;
		}
		if(l2[i]<=v[i]&&v[i]<=r2[i]){
			gl[i]=l1[i];gr[i]=r1[i];
			if(!(fl[i+1]<=v[i]&&v[i]<=fr[i+1])){
				gl[i]=max(gl[i],gl[i+1]);
				gr[i]=min(gr[i],gr[i+1]);
			}
		}
		else{
			gl[i]=m;gr[i]=0;
		}
	}
	if(fl[1]>0&&gl[1]>0){
		puts("No");
		return 0;
	}
	puts("Yes");
	int x=0,y=0;
	rep(i,n){
		if(fl[i]<=y&&y<=fr[i]){
			x=v[i];
			printf("0 ");
		}
		else{
			y=v[i];
			printf("1 ");
		}
	}
	return 0;
}