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

#define int int64_t //be careful about this 
#define endl "\n"

#define pr pair
#define ar array
#define fr first
#define sc second
#define vt vector
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define SZ(x) ((int)(x).size())
#define all(a) (a).begin(),(a).end()
#define allr(a) (a).rbegin(),(a).rend()
#define mem(a,b) memset(a, b, sizeof(a))

template<class A> void rd(vt<A>& v);
template<class T> void rd(T& x){ cin >> x;}
template<class H, class... T> void rd(H& h, T&... t) { rd(h); rd(t...);}
template<class A> void rd(vt<A>& x) { for(auto& a : x) rd(a);}

template<class T> bool ckmin(T& a, const T b) { return b < a ? a = b, 1 : 0;}
template<class T> bool ckmax(T& a, const T b) { return a < b ? a = b, 1 : 0;}

template<typename T>
void __p(T a) {
  cout<<a; 
}
template<typename T, typename F>
void __p(pair<T, F> a) {
  cout<<"{";
  __p(a.first);
  cout<<",";
  __p(a.second);
  cout<<"}\n"; 
}
template<typename T>
void __p(std::vector<T> a) {
  cout<<"{";
  for(auto it=a.begin(); it<a.end(); it++)
    __p(*it),cout<<",}\n"[it+1==a.end()]; 
}
template<typename T, typename ...Arg>
void __p(T a1, Arg ...a) {
  __p(a1);
  __p(a...);
}
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cout<<name<<" : ";
  __p(arg1);
  cout<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
  int bracket=0,i=0;
  for(;; i++)
    if(names[i]==','&&bracket==0)
      break;
    else if(names[i]=='(')
      bracket++;
    else if(names[i]==')')
      bracket--;
  const char *comma=names+i;
  cout.write(names,comma-names)<<" : ";
  __p(arg1);
  cout<<" | ";
  __f(comma+1,args...);
}


void setIO(string s = "") {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
  // remove this when size of input is not fixed.
  cin.exceptions(cin.failbit); 
	cout.precision(15);	cout << fixed;
  if(SZ(s)){
  	freopen((s+".in").c_str(),"r",stdin);
  	freopen((s+".out").c_str(),"w",stdout);
  }
}


/*/--------------------------------------------------look below-----------------------------------------------------------------------------------/*/







































template<class T> 
struct static_range_min_query {
	
	int level(int x) {
		return 31 - __builtin_clz(x);
	}
	
	vector<T> v;
	vector<vector<int>> jmp;
	
	int comb(int a, int b){
		return v[a] == v[b] ? min(a,b) : (v[a] < v[b] ? a : b);
	}
	
	void init(const vector<T> & _v){
		v = _v; 
		jmp = {vector<int> (int(_v.size()))};
		iota(begin(jmp[0]),end(jmp[0]),0);
		for(int j = 1; (1 << j) <= int(_v.size()); ++j){
			jmp.push_back(vector<int> (int(_v.size()) - (1 << j) + 1));
			for(int i = 0; i < int(jmp[j].size()); ++i){
				jmp[j][i] = comb(jmp[j-1][i], jmp[j-1][i + (1 << (j - 1))]);
			}
		}	
	}
	
	int index(int l, int r){
		assert(l <= r);
		int d = level(r - l + 1);
		return comb(jmp[d][l], jmp[d][r - (1 << d) + 1]);
	}
	
	T query(int l, int r){
		return v[index(l,r)];
	}
	
};

template<class T> 
struct static_range_max_query {
	
	int level(int x) {
		return 31 - __builtin_clz(x);
	}
	
	vector<T> v;
	vector<vector<int>> jmp;
	
	int comb(int a, int b){
		return v[a] == v[b] ? min(a,b) : (v[a] > v[b] ? a : b);
	}
	
	void init(const vector<T> & _v){
		v = _v; 
		jmp = {vector<int> (int(_v.size()))};
		iota(begin(jmp[0]),end(jmp[0]),0);
		for(int j = 1; (1 << j) <= int(_v.size()); ++j){
			jmp.push_back(vector<int> (int(_v.size()) - (1 << j) + 1));
			for(int i = 0; i < int(jmp[j].size()); ++i){
				jmp[j][i] = comb(jmp[j-1][i], jmp[j-1][i + (1 << (j - 1))]);
			}
		}	
	}
	
	int index(int l, int r){
		assert(l <= r);
		int d = level(r - l + 1);
		return comb(jmp[d][l], jmp[d][r - (1 << d) + 1]);
	}
	
	T query(int l, int r){
		return v[index(l,r)];
	}
	
};

static_range_min_query<int> range_minl, range_minr;
static_range_max_query<int> range_maxl, range_maxr; 

bool in(int x, int l, int r){
	return l <= x && x <= r;
}

signed main(){
  setIO();
  int n,m; rd(n,m);
  
  vt<int> k(n+1,0), sl(n+1,0), el(n+1,0), sr(n+1,0), er(n+1,0);
  
  for(int i = 1; i <= n; ++i){
  	rd(k[i],sl[i],el[i],sr[i],er[i]);
  }
  
  
  range_maxl.init(sl);
  range_minl.init(el);
  
  range_maxr.init(sr);
  range_minr.init(er);
  
  
  vt<int> tl(n+1,-1), tr(n+1,-1);
  
  for(int i = n; i >= 0; --i){
  	int x = k[i];
  	if(!in(x,sl[i],el[i])) continue;
  	int lo = i, hi = n + 1;
  	while(hi - lo > 1){
  		int mid = (hi + lo)/2;
  		in(x,range_maxl.query(i,mid),range_minl.query(i,mid)) ? lo = mid : hi = mid;
  	}
  	tl[i] = lo;
  }
  
  for(int i = n; i >= 0; --i){
  	int x = k[i];
  	if(!in(x,sr[i],er[i])) continue;
  	int lo = i, hi = n + 1;
  	while(hi - lo > 1){
  		int mid = (hi + lo)/2;
  		in(x,range_maxr.query(i,mid),range_minr.query(i,mid)) ? lo = mid : hi = mid;
  	}
  	tr[i] = lo;
  }
  
  
  vt<int> nl(n+1,-1), nr(n+1,-1);
  
  for(int i = n; i >= 0; --i){
  	int x = k[i];
  	if(!in(x,sl[i],el[i])) continue;
  	nl[i] = i;
  	if(i < n && nl[i+1] != -1) nl[i] = nl[i+1];
  }
  
  for(int i = n; i >= 0; --i){
  	int x = k[i];
  	if(!in(x,sr[i],er[i])) continue;
  	nr[i] = i;
  	if(i < n && nr[i+1] != -1) nr[i] = nr[i+1];
  }
  
  vt<int> nxt0(n,-1), nxt1(n,-1);
  
  int latest0 = -1, latest1 = -1;
  
  for(int i = n - 1; i >= 0; --i){
  	if(tl[i] == n && nr[i+1] == n){
  		nxt0[i] = n;
  	}else{
  		if(latest1 != -1){
  			if(tl[i] >= latest1 && nr[i+1] >= latest1){
  				nxt0[i] = latest1;
  			}
  		}
  	}
  	
  	if(tr[i] == n && nl[i+1] == n){
  		nxt1[i] = n;
  		latest1 = i;
  	}else{
  		if(latest0 != -1){
  			if(tr[i] >= latest0 && nl[i+1] >= latest0){
  				nxt1[i] = latest0;
  			}
  		}
  	}
  	
  	if(nxt0[i] != -1) latest0 = i;
  	if(nxt1[i] != -1) latest1 = i;
  }
  
  vt<int> ans(n+1);
  
  if(nxt0[0] != -1){
  	cout << "Yes" << endl;
  	
  	int now = 0, j = 0;
  	while(j < n){
  		int from = j + 1, to = (now == 0 ? nxt0[j] : nxt1[j]);
  		assert(from <= to);
  		for(int i = from; i <= to; ++i) ans[i] = (now^1);
  		j = to; now^=1;
  	}
  	
  	for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
  	
  }else if(nxt1[0] != -1){
  	cout << "Yes" << endl;
  	
  	int now = 1, j = 0;
  	while(j < n){
  		int from = j + 1, to = (now == 0 ? nxt0[j] : nxt1[j]);
  		assert(from <= to);
  		for(int i = from; i <= to; ++i) ans[i] = (now^1);
  		j = to; now^=1;
  	}
  	
  	for(int i = 1; i <= n; ++i) cout << ans[i] << " ";
  	
  }else{
  	cout << "No";
  }
}

























