#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
struct cc {
  int l, r, len, num;
  bool operator<(const cc &x) const { return len < x.len; }
} a[maxn];
int b[maxn], sum[maxn << 2], add[maxn << 2], ans, f[maxn][20];
void push_down(int rt) {
  if (add[rt]) {
    sum[rt << 1] |= add[rt];
    sum[rt << 1 | 1] |= add[rt];
    add[rt << 1] |= add[rt];
    add[rt << 1 | 1] |= add[rt];
    add[rt] = 0;
  }
}
void update(int L, int R, int l, int r, int rt, int x) {
  if (l >= L && r <= R) {
    sum[rt] = sum[rt] | x;
    add[rt] = add[rt] | x;
    return;
  }
  push_down(rt);
  int mid = (l + r) >> 1;
  if (L <= mid) update(L, R, l, mid, rt << 1, x);
  if (mid < R) update(L, R, mid + 1, r, rt << 1 | 1, x);
}
int ask(int l, int r) {
  int k = log2(r - l + 1);
  return f[l][k] & f[r - (1 << k) + 1][k];
}
void query(int x, int l, int r, int rt) {
  if (l == r) {
    ans = sum[rt];
    return;
  }
  push_down(rt);
  int mid = (l + r) >> 1;
  if (x <= mid)
    query(x, l, mid, rt << 1);
  else
    query(x, mid + 1, r, rt << 1 | 1);
}
int main() {
  int n, m, i, j, k, num;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d%d", &a[i].l, &a[i].r, &a[i].num);
    update(a[i].l, a[i].r, 1, n, 1, a[i].num);
  }
  for (i = 1; i <= n; i++) {
    query(i, 1, n, 1);
    f[i][0] = ans;
  }
  for (j = 1; (1 << j) <= n; j++)
    for (i = 1; i + (1 << j) - 1 <= n; i++) {
      f[i][j] = f[i][j - 1] & f[i + (1 << (j - 1))][j - 1];
    }
  for (i = 1; i <= m; i++) {
    if (ask(a[i].l, a[i].r) != a[i].num) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) printf("%d ", f[i][0]);
  printf("\n");
  return 0;
}
