#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<int> node;
struct T {
  int l, r, col;
} tree[maxn << 2];
void pushdown(int rt) {
  if (tree[rt].l == tree[rt].r) return;
  tree[rt << 1 | 1].col |= tree[rt].col;
  tree[rt << 1].col |= tree[rt].col;
  pushdown(rt << 1 | 1);
  pushdown(rt << 1);
}
void build(int L, int R, int rt) {
  tree[rt].l = L;
  tree[rt].r = R;
  tree[rt].col = 0;
  if (L == R) {
    node.push_back(rt);
    return;
  }
  int mid = (tree[rt].l + tree[rt].r) >> 1;
  ;
  build(L, mid, rt << 1);
  build(mid + 1, R, rt << 1 | 1);
}
void update(int l, int r, int rt, int val) {
  if (tree[rt].l == l && tree[rt].r == r) {
    tree[rt].col |= val;
    return;
  }
  int mid = (tree[rt].l + tree[rt].r) >> 1;
  ;
  if (l > mid)
    update(l, r, rt << 1 | 1, val);
  else if (r <= mid)
    update(l, r, rt << 1, val);
  else {
    update(l, mid, rt << 1, val);
    update(mid + 1, r, rt << 1 | 1, val);
  }
}
int query(int l, int r, int rt) {
  if (tree[rt].l == l && tree[rt].r == r) {
    return tree[rt].col;
  }
  int mid = (tree[rt].l + tree[rt].r) >> 1;
  ;
  if (l > mid)
    return query(l, r, rt << 1 | 1);
  else if (r <= mid)
    return query(l, r, rt << 1);
  return query(l, mid, rt << 1) & query(mid + 1, r, rt << 1 | 1);
}
struct Qu {
  int l, r, p;
} q[maxn];
int main() {
  int N, M;
  int l, r, p;
  node.clear();
  scanf("%d%d", &N, &M);
  build(1, N, 1);
  for (int i = 0; i < M; i++) {
    scanf("%d%d%d", &l, &r, &p);
    q[i] = (Qu){l, r, p};
    update(l, r, 1, p);
  }
  bool label = true;
  for (int i = 0; i < M && label; i++) {
    int ans = query(q[i].l, q[i].r, 1);
    if (ans == q[i].p) continue;
    label = false;
  }
  pushdown(1);
  if (label) {
    printf("YES\n");
    for (int i = 0; i < node.size(); i++)
      printf("%d%c", tree[node[i]].col, i == node.size() - 1 ? '\n' : ' ');
  } else {
    printf("NO\n");
  }
  return 0;
}
