#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const int MAXN = 400010;
int ls[MAXN], rs[MAXN], l[MAXN], r[MAXN], q[MAXN];
int tag[MAXN], n, m;
void build(int cur, int l, int r) {
  tag[cur] = 0;
  ls[cur] = l;
  rs[cur] = r;
  if (l == r) return;
  build(cur * 2, l, (l + r) / 2);
  build(cur * 2 + 1, (l + r) / 2 + 1, r);
}
void pushtag(int x) {
  if (ls[x] != rs[x]) {
    tag[x * 2] |= tag[x];
    tag[x * 2 + 1] |= tag[x];
    tag[x] = 0;
    return;
  }
}
void mark(int cur, int l, int r, int num) {
  if (ls[cur] > r || rs[cur] < l) return;
  if (ls[cur] >= l && rs[cur] <= r) {
    tag[cur] |= num;
    return;
  }
  pushtag(cur);
  mark(cur * 2, l, r, num);
  mark(cur * 2 + 1, l, r, num);
  tag[cur] = tag[cur * 2] & tag[cur * 2 + 1];
}
int check(int cur, int l, int r) {
  if (ls[cur] > r || rs[cur] < l) return INF;
  if (ls[cur] >= l && rs[cur] <= r) return tag[cur];
  pushtag(cur);
  int Cur = INF;
  Cur = check(cur * 2, l, r) & check(cur * 2 + 1, l, r);
  tag[cur] = tag[cur * 2] & tag[cur * 2 + 1];
  return Cur;
}
int main() {
  scanf("%d%d", &n, &m);
  build(1, 1, n);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d%d", &l[i], &r[i], &q[i]);
    mark(1, l[i], r[i], q[i]);
  }
  bool ok = 1;
  for (int i = 1; i <= m; ++i) {
    if (check(1, l[i], r[i]) != q[i]) {
      ok = 0;
      break;
    }
  }
  if (!ok)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", check(1, i, i));
  }
  return 0;
}
