#include <bits/stdc++.h>
using namespace std;
struct dat {
  int L, R, V;
} a[100005];
int N, M;
bool cmp(dat a, dat b) {
  if (a.L != b.L) return a.L < b.L;
  if (a.R != b.R) return a.R < b.R;
  return a.V < b.V;
}
int ans[100005], s[100005];
void build(int k) {
  int last = 0;
  for (int i = (1), _b = (M); i <= _b; i++)
    if (a[i].V >> k & 1) {
      for (int j = (max(last + 1, a[i].L)), _b = (a[i].R); j <= _b; j++)
        ans[j] |= (1 << k);
      last = max(last, a[i].R);
    }
  memset(s, 0, sizeof s);
  for (int i = (1), _b = (N); i <= _b; i++)
    s[i] = s[i - 1] + (!(ans[i] >> k & 1));
  for (int i = (1), _b = (M); i <= _b; i++)
    if (!(a[i].V >> k & 1))
      if (s[a[i].R] == s[a[i].L - 1]) {
        cout << "NO\n";
        exit(0);
      }
}
int main(void) {
  cin >> N >> M;
  for (int i = (1), _b = (M); i <= _b; i++) cin >> a[i].L >> a[i].R >> a[i].V;
  sort(a + 1, a + M + 1, cmp);
  for (int i = (0), _b = (29); i <= _b; i++) build(i);
  cout << "YES\n";
  for (int i = (1), _b = (N); i <= _b; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
