#include <bits/stdc++.h>
using namespace std;
struct Tre {
  int add, sum;
} Tree[400001];
int ans[100001];
struct Node {
  int l, r, q;
} Q[100001];
int x[31], i, j, m, n, p, k, q, l, r, sum;
void down(int t) {
  if (!Tree[t].add) return;
  Tree[(t << 1)].add |= Tree[t].add;
  Tree[(t << 1)].sum |= Tree[t].add;
  Tree[((t << 1) + 1)].add |= Tree[t].add;
  Tree[((t << 1) + 1)].sum |= Tree[t].add;
  Tree[t].add = 0;
}
void update(int ll, int rr, int c, int l, int r, int t) {
  if (ll <= l && r <= rr) {
    Tree[t].sum |= c;
    Tree[t].add |= c;
  } else {
    down(t);
    if (ll <= ((l + r) >> 1)) update(ll, rr, c, l, ((l + r) >> 1), (t << 1));
    if (rr > ((l + r) >> 1))
      update(ll, rr, c, ((l + r) >> 1) + 1, r, ((t << 1) + 1));
    Tree[t].sum = Tree[(t << 1)].sum & Tree[((t << 1) + 1)].sum;
  }
}
void ask(int ll, int rr, int l, int r, int t) {
  if (ll <= l && r <= rr)
    sum &= Tree[t].sum;
  else {
    down(t);
    if (ll <= ((l + r) >> 1)) ask(ll, rr, l, ((l + r) >> 1), (t << 1));
    if (rr > ((l + r) >> 1)) ask(ll, rr, ((l + r) >> 1) + 1, r, ((t << 1) + 1));
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d%d", &Q[i].l, &Q[i].r, &Q[i].q);
    update(Q[i].l, Q[i].r, Q[i].q, 1, n, 1);
  }
  for (i = 1; i <= m; i++) {
    sum = (1 << 30) - 1;
    ask(Q[i].l, Q[i].r, 1, n, 1);
    if (sum != Q[i].q) {
      printf("NO\n");
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    sum = (1 << 30) - 1;
    ask(i, i, 1, n, 1);
    ans[i] = sum;
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) printf("%d ", ans[i]);
}
