#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
struct e
{
    int l, r;
}rg[maxn][2], tmp[2];
int k[maxn], op[maxn][2];
int al[maxn], bl[maxn], ar[maxn], br[maxn];
int main()
{
    int n, m;
    cin>>n>>m;
    for(int i = 1; i <= n; i++)
    {
        cin>>k[i];
        cin>>al[i]>>bl[i];
        cin>>ar[i]>>br[i];
    }
    al[n+1] = ar[n+1] = rg[n+1][0].l = rg[n+1][1].l = 0;
    bl[n+1] = br[n+1] = rg[n+1][0].r = rg[n+1][1].r = m;
    for(int i = n; i > 0; i--)
    {
        rg[i][0].l = al[i];
        rg[i][0].r = bl[i];
        rg[i][1].l = ar[i];
        rg[i][1].r = br[i];
        //保留左手
        if(ar[i] <= k[i] && k[i] <= br[i])
        {
            if(rg[i+1][1].l <= k[i] && k[i] <= rg[i+1][1].r)
            {
                op[i][1] = 0;
            }
            else
            {
                //变更左手保留的区间
                rg[i][0].l = max(rg[i][0].l, rg[i+1][0].l);
                rg[i][0].r = min(rg[i][0].r, rg[i+1][0].r);
                op[i][1] = 1;
            }
        }
        else
        {
            rg[i][0].l = m, rg[i][0].r = 0;
        }
        //保留右手
        if(al[i] <= k[i] && k[i] <= bl[i])
        {
            if(rg[i+1][0].l <= k[i] && k[i] <= rg[i+1][0].r)
            {
                op[i][0] = 1;
            }
            else
            {
                rg[i][1].l = max(rg[i][1].l, rg[i+1][1].l);
                rg[i][1].r = min(rg[i][1].r, rg[i+1][1].r);
                op[i][0] = 0;
            }
        }   
        else
        {
            rg[i][1].l = m, rg[i][1].r = 0;
        } 
    }
    
    if((rg[1][0].l <= 0 && 0 <= rg[1][0].r) || (rg[1][1].l <= 0 && 0 <= rg[1][1].r))
    {
        cout<<"Yes"<<endl;
        int o;
        if(rg[1][0].l <= 0 && 0 <= rg[1][0].r)
            o = 1;
        else
            o = 0;
        for(int i = 1; i <= n; i++)
        {
            cout<<o<<" ";
            o = op[i][o];
        }
        cout<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;
}