#include <bits/stdc++.h>

using namespace std;

using pii = pair<int, int>;

bool verify_solush(const vector<int>& k, const vector<array<pii, 2>>& range_bounds, const vector<bool>& solush) {
  int n = k.size();
  array<int, 2> cur{0, 0};
  for (int i = 0; i < n; ++i) {
    cur[solush[i] ? 1 : 0] = k[i];
    for (int j = 0; j < 2; ++j) {
      if (cur[j] < range_bounds[i][j].first) {
	return false;
      }
      if (cur[j] > range_bounds[i][j].second) {
	return false;
      }
    }
  }
  return true;
}

pii overlap(const pii& x, const pii& y) {
  return {max(x.first, y.first), min(x.second, y.second)};
}

bool within(const pii& p, int k) {
  return (k >= p.first) && (k <= p.second);
}

void add_constraint(vector<array<pii, 2>>& cons, const array<pii, 2>& newco) {
  int n = cons.size();
  for (int i = 0; i < n; ++i) {
    array<pii, 2> ov{overlap(cons[i][0], newco[0]), overlap(cons[i][1], newco[1])};
    if (ov == newco) {
      return;
    }
    if (ov == cons[i]) {
      cons[i] = newco;
      return;
    }
  }
  cons.push_back(newco);
}

bool both_within(const array<pii, 2>& co, const array<int, 2>& nums) {
  return within(co[0], nums[0]) && within(co[1], nums[1]);
}

bool any_within(const vector<array<pii, 2>>& cons, const array<int, 2>& nums) {
  for (const array<pii, 2>& co : cons) {
    if (both_within(co, nums)) {
      return true;
    }
  }
  return false;
}

vector<bool> solve(int m, const vector<int>& k, const vector<array<pii, 2>>& range_bounds) {
  int n = k.size();
  vector<vector<array<pii, 2>>> dp(n+1);
  const pii NOCO(0, m);
  dp[n].push_back({NOCO, NOCO});
  for (int i = n-1; i >= 0; --i) {
    for (const array<pii, 2>& co : dp[i+1]) {
      array<pii, 2> newco{overlap(range_bounds[i][0], co[0]), overlap(range_bounds[i][1], co[1])};
      for (int j = 0; j < 2; ++j) {
	if (within(newco[j], k[i])) {
	  array<pii, 2> newco2 = newco;
	  newco2[j] = NOCO;
	  add_constraint(dp[i], newco2);
	}
      }
    }
    if (dp[i].empty()) {
      return {};
    }
    assert(int(dp[i].size()) <= 2);
  }
  array<int, 2> nums{0, 0};
  if (!any_within(dp[0], nums)) {
    return {};
  }
  vector<bool> solush(n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 2; ++j) {
      array<int, 2> nextnums = nums;
      nextnums[j] = k[i];
      if (both_within(range_bounds[i], nextnums) && any_within(dp[i+1], nextnums)) {
	solush[i] = (j == 1);
	nextnums.swap(nums);
	break;
      }
    }
  }
  return solush;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> k(n);
  vector<array<pii, 2>> range_bounds(n);
  for (int i = 0; i < n; ++i) {
    cin >> k[i] >> range_bounds[i][0].first >> range_bounds[i][0].second >> range_bounds[i][1].first >> range_bounds[i][1].second;
  }
  vector<bool> solush = solve(m, k, range_bounds);
  if (solush.empty()) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  for (int i = 0; i < n; ++i) {
    if (i > 0) cout << " ";
    cout << (solush[i] ? "1" : "0");
  }
  cout << endl;
  assert(verify_solush(k, range_bounds, solush));
}
