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

// editorial (solution without set)

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<vector<int>> dp(n + 2, vector<int>(2));
    vector<vector<int>> q(n + 1, vector<int>(5));
    vector<vector<int>> c(n + 2, vector<int>(2));
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < 5; j++) {
            cin >> q[i][j];
        }
    }
    c[n + 1][0] = c[n + 1][1] = dp[n + 1][0] = dp[n + 1][1] = 1;
    vector<int> ok(2, 1);
    vector<int> lo(2, 0), hi(2, m);
    for (int i = n; i >= 0; i--) {
        int k = q[i][0];
        vector<int> a = {q[i][1], q[i][3]};
        vector<int> b = {q[i][2], q[i][4]};
        vector<int> new_ok = ok;
        for (int j = 0; j < 2; j++) {
            if (a[j] <= k && k <= b[j]) {
                c[i][j] = 1;
            } else {
                new_ok[j] = 0;
            }
            lo[j] = max(lo[j], a[j]);
            hi[j] = min(hi[j], b[j]);
        }
        vector<int> new_lo = lo;
        vector<int> new_hi = hi;
        for (int j = 0; j < 2; j++) {
            if (c[i][j] && ok[j ^ 1] && lo[j] <= k && k <= hi[j]) {
                new_ok[j] = 1;
                dp[i][j] = 1;
                new_lo[j ^ 1] = a[j ^ 1];
                new_hi[j ^ 1] = b[j ^ 1];
            }
        }
        swap(ok, new_ok);
        swap(lo, new_lo);
        swap(hi, new_hi);
    }
    debug(dp);
    if (dp[0][0] + dp[0][1] == 0) {
        cout << "No" << '\n';
        return 0;
    }
    int k = 0;
    if (dp[0][1] == 0) {
        k = 1;
    }
    cout << "Yes" << '\n';
    for (int i = 1; i <= n; i++) {
        cout << k << " ";
        if (dp[i][k] == 1) {
            k ^= 1;
        }
    }
    cout << '\n';
    return 0;
}