#include<bits/stdc++.h>

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);std::cout.tie(nullptr);
    int n, m;
    std::cin >> n >> m;
    std::vector<int> k(n), al(n), ar(n), bl(n), br(n);
    for(int i = 0; i < n; ++i)
    {
        std::cin >> k[i];
        std::cin >> al[i] >> bl[i];
        std::cin >> ar[i] >> br[i];
    }
    std::vector<int> cl(n + 1), cr(n + 1), dl(n + 1), dr(n + 1);
    cl[n] = 0;
    dl[n] = m;
    cr[n] = 0;
    dr[n] = m;
    for(int i = n - 1; i >= 0; i--)
    {
        cl[i] = m + 1;
        dl[i] = 0;
        cr[i] = m + 1;
        dr[i] = 0;
        if(al[i] <= k[i] && k[i] <= bl[i])
        {
            if(cl[i + 1] <= k[i] && k[i] <= dl[i + 1])
            {
                cr[i] = ar[i];  
                dr[i] = br[i];
            }
            else
            {
                cr[i] = std::max(ar[i], cr[i + 1]);
                dr[i] = std::min(br[i], dr[i + 1]);
            }
        }
        if(ar[i] <= k[i] && k[i] <= br[i])
        {
            if(cr[i + 1] <= k[i] && k[i] <= dr[i + 1])
            {
                cl[i] = al[i];
                dl[i] = bl[i];
            }
            else
            {
                cl[i] = std::max(al[i], cl[i + 1]);
                dl[i] = std::min(bl[i], dl[i + 1]);
            }
        }
        //std::cout << cl[i] << " " << dl[i] << '|' << cr[i] << " " << dr[i] << std::endl;
    }
    if(cl[0] <= 0 && 0 <= dl[0] || cr[0] <= 0 && 0 <= dr[0])
    {
        std::cout << "Yes\n";
        int l = 0, r = 0;
        for(int i = 0; i < n; ++i)
        {
            //std::cout << cr[i] << " " << r << " " << dr[i] << std::endl;
            //std::cout << al[i] << " " << k[i] << " " << bl[i] << std::endl;
            if(al[i] <= k[i] && k[i] <= bl[i] && cr[i] <= r && r <= dr[i])
            {
                l = k[i];
                std::cout << 0 << " \n"[i == n - 1];
            }
            else
            {
                r = k[i];
                std::cout << 1 << " \n"[i == n - 1];
            }
            //std::cout << std::endl;
        }
    }
    else
    {
        std::cout << "No\n";
    }
}