#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
int seg[maxn << 2], lazy[maxn << 2], ul, ur;
void pushup(int cur) { seg[cur] = seg[cur << 1] & seg[cur << 1 | 1]; }
void pushdown(int cur) {
  if (lazy[cur]) {
    seg[cur << 1] |= lazy[cur];
    seg[cur << 1 | 1] |= lazy[cur];
    lazy[cur << 1] |= lazy[cur];
    lazy[cur << 1 | 1] |= lazy[cur];
    lazy[cur] = 0;
  }
}
void update(int cur, int l, int r, int val) {
  if (ul <= l && r <= ur) {
    lazy[cur] |= val;
    seg[cur] |= val;
    return;
  }
  pushdown(cur);
  int mid = l + r >> 1;
  if (ul <= mid) update(cur << 1, l, mid, val);
  if (mid < ur) update(cur << 1 | 1, mid + 1, r, val);
  pushup(cur);
}
int query(int cur, int l, int r) {
  int ret = (1 << 30) - 1;
  if (ul <= l && r <= ur) {
    return seg[cur];
  }
  pushdown(cur);
  int mid = l + r >> 1;
  if (ul <= mid) ret &= query(cur << 1, l, mid);
  if (mid < ur) ret &= query(cur << 1 | 1, mid + 1, r);
  pushup(cur);
  return ret;
}
int n, m, l[maxn], r[maxn], q[maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d%d", l + i, r + i, q + i);
    ul = l[i], ur = r[i];
    update(1, 1, n, q[i]);
  }
  bool ok = true;
  for (int i = 0; ok && i < m; ++i) {
    ul = l[i], ur = r[i];
    if (query(1, 1, n) != q[i]) ok = false;
  }
  if (!ok)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 1; i <= n; ++i) {
      ul = ur = i;
      printf("%d ", query(1, 1, n));
    }
  }
  return 0;
}
