#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
struct node {
  int l, r, q;
  bool operator<(const node &b) const {
    if (r == b.r)
      return l < b.l;
    else
      return r < b.r;
  }
} a[maxn];
int tree[maxn << 2];
int lazy[maxn << 2];
void pushup(int rt) { tree[rt] = (tree[rt << 1] & tree[rt << 1 | 1]); }
void pushdown(int rt) {
  if (lazy[rt] == 0) return;
  lazy[rt << 1] |= lazy[rt];
  lazy[rt << 1 | 1] |= lazy[rt];
  tree[rt << 1] |= lazy[rt];
  tree[rt << 1 | 1] |= lazy[rt];
  lazy[rt] = 0;
}
void update(int rt, int l, int r, int begin, int end, int val) {
  if (begin <= l && r <= end) {
    tree[rt] |= val;
    lazy[rt] |= val;
    return;
  }
  pushdown(rt);
  int mid = (l + r) >> 1;
  if (begin <= mid) update(rt << 1, l, mid, begin, end, val);
  if (mid + 1 <= end) update(rt << 1 | 1, mid + 1, r, begin, end, val);
  pushup(rt);
}
int query(int rt, int l, int r, int begin, int end) {
  if (begin <= l && r <= end) {
    return tree[rt];
  }
  pushdown(rt);
  int mid = (l + r) >> 1;
  int res = (1 << 30) - 1;
  if (begin <= mid) res &= query(rt << 1, l, mid, begin, end);
  if (mid + 1 <= end) res &= query(rt << 1 | 1, mid + 1, r, begin, end);
  return res;
}
int main(void) {
  memset(tree, 0, sizeof(tree));
  memset(lazy, 0, sizeof(lazy));
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &a[i].l, &a[i].r, &a[i].q);
    update(1, 1, n, a[i].l, a[i].r, a[i].q);
  }
  bool flag = true;
  for (int i = 1; i <= m; i++) {
    int t = query(1, 1, n, a[i].l, a[i].r);
    if (t != a[i].q) {
      flag = false;
      break;
    }
  }
  if (flag == false)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      int x = query(1, 1, n, i, i);
      printf("%d%c", x, (i == n) ? '\n' : ' ');
    }
  }
  return 0;
}
