#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    set<pair<int, int>> sl, sr;
    sl.emplace(0, -1);
    sr.emplace(0, -1);
    set<int> tl, tr;
    tl.emplace(-1);
    tr.emplace(-1);
    vector<int> ans(n, -1);
    auto del_range = [&](set<pair<int, int>>& st, set<int>& tt, int lo, int hi) {
        while (!st.empty() && (*st.begin()).first < lo) {
            tt.erase((*st.begin()).second);
            st.erase(st.begin());
        }
        while (!st.empty() && (*prev(st.end())).first > hi) {
            tt.erase((*prev(st.end())).second);
            st.erase(prev(st.end()));
        }
    };
    vector<int> x(n, -2), y(n, -2);
    for (int i = 0; i < n; i++) {
        debug(sl, sr);
        int k, al, bl, ar, br;
        cin >> k >> al >> bl >> ar >> br;
        if ((k < al || bl < k) && (k < ar || br < k)) {
            cout << "No" << '\n';
            return 0;
        } else if (al <= k && k <= bl && ar <= k && k <= br) {
            del_range(sl, tl, al, bl);
            del_range(sr, tr, ar, br);
            if (sl.empty() && sr.empty()) {
                cout << "No" << '\n';
                return 0;
            }
            if (sl.empty()) {
                ans[i] = 0;
                sl.emplace(k, i);
                tl.emplace(i);
            } else if (sr.empty()) {
                ans[i] = 1;
                sr.emplace(k, i);
                tr.emplace(i);
            } else {
                sl.emplace(k, i);
                sr.emplace(k, i);
                tl.emplace(i);
                tr.emplace(i);
            }
        } else if (k < al || bl < k) {
            ans[i] = 1;
            sr.clear();
            tr.clear();
            sr.emplace(k, i);
            tr.emplace(i);
            del_range(sl, tl, al, bl);
            if (sl.empty()) {
                cout << "No" << '\n';
                return 0;
            }
        } else if (k < ar || br < k) {
            ans[i] = 0;
            sl.clear();
            tl.clear();
            sl.emplace(k, i);
            tl.emplace(i);
            del_range(sr, tr, ar, br);
            if (sr.empty()) {
                cout << "No" << '\n';
                return 0;
            }
        }
        debug(sl);
        debug(sr);
        x[i] = *tl.begin();
        y[i] = *tr.begin();
    }
    int id = n - 1, p = 0;
    if (x[id] > y[id]) {
        p = 1;
    }
    while (id >= 0) {
        int nid = (p == 0 ? x[id] : y[id]);
        if (nid >= 0) {
            ans[nid] = p;
        }
        p ^= 1;
        for (int i = nid + 1; i <= id; i++) {
            ans[i] = p;
        }
        id = nid;
    }
    cout << "Yes" << '\n';
    for (int i : ans) {
        cout << i << " ";
    }
    cout << '\n';
    return 0;
}