#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int sum[maxn << 2];
int mark[maxn << 2];
struct node {
  int l, r, q;
} no[maxn];
void PushDown(int rt) {
  if (!mark[rt]) return;
  sum[rt << 1] = sum[rt << 1] | mark[rt];
  sum[rt << 1 | 1] = sum[rt << 1 | 1] | mark[rt];
  mark[rt << 1] = mark[rt << 1] | mark[rt];
  mark[rt << 1 | 1] = mark[rt << 1 | 1] | mark[rt];
  mark[rt] = 0;
}
int query(int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) {
    return sum[rt];
  }
  PushDown(rt);
  int m = l + r >> 1;
  if (L > m) return query(L, R, m + 1, r, rt << 1 | 1);
  if (R <= m) return query(L, R, l, m, rt << 1);
  return query(L, R, l, m, rt << 1) & query(L, R, m + 1, r, rt << 1 | 1);
}
void update(int L, int R, int c, int l, int r, int rt) {
  if (L <= l && r <= R) {
    sum[rt] = sum[rt] | c;
    mark[rt] = mark[rt] | c;
    return;
  }
  PushDown(rt);
  int m = (l + r) >> 1;
  if (L <= m) update(L, R, c, l, m, rt << 1);
  if (m < R) update(L, R, c, m + 1, r, rt << 1 | 1);
}
void print(int pos, int l, int r, int rt) {
  if (l == r) {
    cout << sum[rt] << " ";
    return;
  }
  PushDown(rt);
  int m = l + r >> 1;
  if (pos <= m)
    print(pos, l, m, rt << 1);
  else
    print(pos, m + 1, r, rt << 1 | 1);
}
int main() {
  int m, n;
  while (~scanf("%d%d", &n, &m)) {
    memset(sum, 0, sizeof(sum));
    memset(mark, 0, sizeof(mark));
    for (int i = 0; i < m; i++) {
      scanf("%d%d%d", &no[i].l, &no[i].r, &no[i].q);
      update(no[i].l, no[i].r, no[i].q, 1, n, 1);
    }
    int flag = 1;
    for (int i = 0; i < m; i++) {
      int x = query(no[i].l, no[i].r, 1, n, 1);
      if (x != no[i].q) {
        flag = 0;
        break;
      }
    }
    if (flag == 0)
      printf("NO\n");
    else {
      printf("YES\n");
      for (int i = 1; i <= n; i++) {
        print(i, 1, n, 1);
      }
      puts("");
    }
  }
  return 0;
}
