#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int sz = 1e5+7;

int n, m, v[sz], l[sz][2], r[sz][2], dp[sz][2];
int cl[2], cr[2], ok[2];

void go(int i, int j) {
   if(i > n) exit(0);
   printf("%d ", j); j ^= dp[i][j];
   go(i + 1, j);
}

int main() {
   cin >> n >> m;
   for(int i=1; i<=n; i++) {
      scanf("%d", &v[i]);
      for(int j=0; j<2; j++) scanf("%d %d", &l[i][j], &r[i][j]);
   }
   for(int j=0; j<2; j++) ok[j] = 1, cr[j] = r[n][j];
   for(int i=n; i>=0; i--) {
      vector <int> d;
      for(int j=0; j<2; j++)
         cl[j] = max(cl[j], l[i][j]), cr[j] = min(cr[j], r[i][j]);
      for(int j=0; j<2; j++)
         if(cl[j] <= v[i] and v[i] <= cr[j] and ok[j ^ 1]) d.push_back(j ^ 1);
      for(int j : d)
         dp[i][j ^ 1] = ok[j ^ 1] = 1, cl[j] = l[i][j], cr[j] = r[i][j];
      for(int j=0; j<2; j++)
         if(l[i][j] > v[i] or v[i] > r[i][j]) ok[j] = 0;
   }
   for(int j=0; j<2; j++) if(dp[0][j]) puts("Yes"), go(1, j ^ 1);
   puts("No");
}
