///100gods

#include <bits/stdc++.h>
#define int long long
#define vec2 vector<vector<int>>
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define FRE freopen("elegant.in","r",stdin);freopen("elegant.out","w",stdout)
#define pii pair <int,int>
#define vii vector <int>
#define vpii vector <pii>
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define minii LLONG_MAX
#define all(x) x.begin(), x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define double long double
#define eb emplace_back
const double pi = 3.1415926535898;
const int mod=1e9+7;
//const int mod=998244353;

using namespace std;

int32_t main()
{
    fio;
    int n,m,k,lr,ll,rr,rl;
    cin>>n>>m;
    int dp[n+2][2];
    dp[0][0]=dp[1][1]=1;
    set <pair<int,int>> left,right,leftrev,rightrev;
    left.insert({0,0});
    right.insert({0,0});
    leftrev.insert({0,0});
    rightrev.insert({0,0});
    int failR = -1, failL = -1;
    for (int i=1;i<=n;i++)
    {
        cin>>k;
        cin>>ll>>lr>>rl>>rr;
        dp[i][0]=dp[i][1]=-1;
        if(k < ll || k > lr)
            failL = i;
        if(k < rl || k > rr)
            failR = i;
        while (left.size())
        {
            auto it=left.begin();
            if (it->ff>=ll)
            {
                break;
            }
            leftrev.erase({it->ss,it->ff});
            left.erase(it);
        }
        while (left.size())
        {
            auto it=left.end();
            it--;
            if (it->ff<=lr)
            {
                break;
            }
            leftrev.erase({it->ss,it->ff});
            left.erase(it);
        }

        while (right.size())
        {
            auto it=right.begin();
            if (it->ff>=rl)
            {
                break;
            }
            rightrev.erase({it->ss,it->ff});
            right.erase(it);
        }
        while (right.size())
        {
            auto it=right.end();
            it--;
            if (it->ff<=rr)
            {
                break;
            }
            rightrev.erase({it->ss,it->ff});
            right.erase(it);
        }

        if (left.size())
        {
            auto it=leftrev.end();
            it--;
            if (failR<=it->ff)
            {
                dp[i][1]=i-it->ff;
            }
        }
        if (right.size())
        {
            auto it=rightrev.end();
            it--;
            if (failL<=it->ff)
            {
                dp[i][0]=i-it->ff;
            }
        }
        if (dp[i][1]!=-1)
        {
            right.insert({k,i});
            rightrev.insert({i,k});
        }
        if (dp[i][0]!=-1)
        {
            left.insert({k,i});
            leftrev.insert({i,k});
        }
    }
    if (dp[n][0]==-1&&dp[n][1]==-1)
    {
        cout<<"No\n";
        exit(0);
    }
    cout<<"Yes\n";
    int f=0,x=n;
    if (dp[n][1]!=-1)
    {
        f=1;
    }
    vii ans;
    while (x)
    {
        for (int i=0;i<dp[x][f];i++)
        {
            ans.pb(f);
        }
        x-=dp[x][f];
        f=1-f;
    }
    reverse(all(ans));
    for (auto i:ans)
    {
        cout<<i<<" ";
    }
    return 0;
}
