#include <bits/stdc++.h>
#define ll long long
#define loop(i, a, b) for(ll i=a;i<b;++i)
#define pool(i, a, b) for(ll i=a-1;i>=b;--i)
#define fore(i, a) for(auto&& i:a)
#define fi first
#define se second
#define ps(a) push_back(a)
#define pb(a) pop_back(a)
#define eb(...) emplace_back(__VA_ARGS__)
#define sc scanf
#define vc vector
#define lb lower_bound
#define ub upper_bound
#define all(a) a.begin(), a.end()
#define llmax LLONG_MAX/2
#define llmin -LLONG_MAX/2
using namespace std;
#define mn 500100
#define par pair<ll, ll>
#define ld long double
#define mod 1000000007
 
int main() {
    ll n, m;cin >> n >> m;
    
    set<par> l, r;
    l.insert(make_pair(0, -1));
    r.insert(make_pair(0, -1));
    
    function<set<par>::iterator ()> zadl=[&](){
        auto ret=l.end();ret--;
        return ret;
    };
    function<set<par>::iterator ()> zadr=[&](){
        auto ret=r.end();ret--;
        return ret;
    };
    
    vc<ll> ans(n, -1);
    vc<vc<ll>> pre(2, vc<ll> (n, -1));
    
    loop(i, 0, n){
        ll k;cin >> k;
        ll l1, r1, l2, r2;cin >> l1 >> r1 >> l2 >> r2;
        
        while(l.size() and (l.begin()->fi < l1 or l.begin()->fi > r1)) l.erase(l.begin());
        while(r.size() and (r.begin()->fi < l2 or r.begin()->fi > r2)) r.erase(r.begin());
        while(l.size() and (zadl()->fi < l1 or zadl()->fi > r1)) l.erase(zadl());
        while(r.size() and (zadr()->fi < l2 or zadr()->fi > r2)) r.erase(zadr());
        
        par f1=make_pair((ll)-1, (ll)-1), f2=make_pair((ll)-1, (ll)-1);
        
        if(l1<=k and k<=r1 and r.size()) ans[i]=0, pre[0][i]=r.begin()->se, f1=make_pair(k, i);
        else r.clear();
        if(l2<=k and k<=r2 and l.size()) ans[i]=1, pre[1][i]=l.begin()->se, f2=make_pair(k, i);
        else l.clear();
        
        if(f1!=make_pair((ll)-1, (ll)-1)) l.insert(f1);
        if(f2!=make_pair((ll)-1, (ll)-1)) r.insert(f2);
    }
    
    if(ans[n-1]==-1) cout << "No"<<endl;
    else{
        cout << "Yes"<<endl;
        
        vc<ll> fans(n);
        ll cur=n-1, katir=ans[n-1];
        while(cur>=0){
            loop(i, pre[katir][cur]+1, cur+1) fans[i]=katir;
            cur=pre[katir][cur];
            katir= !katir;
        }
        
        loop(i, 0, n) cout << fans[i]<<" ";cout <<endl;
    }
}