#include <bits/stdc++.h>
using namespace std;
struct node {
  int l, r, val;
} a[1000000 + 10];
int num[1000000 + 10], laze[1000000 + 10];
void pushup(int l, int r, int rt) { num[rt] = num[rt * 2] & num[rt * 2 + 1]; }
void pushdown(int l, int r, int rt) {
  if (laze[rt]) {
    num[rt * 2] |= laze[rt];
    num[rt * 2 + 1] |= laze[rt];
    laze[rt * 2] |= laze[rt];
    laze[rt * 2 + 1] |= laze[rt];
    laze[rt] = 0;
  }
}
void build(int l, int r, int rt) {
  if (l == r) {
    return;
  }
  int mid = (l + r) / 2;
  build(l, mid, rt * 2);
  build(mid + 1, r, rt * 2 + 1);
  pushup(l, r, rt);
}
void updata(int l, int r, int ql, int qr, int val, int rt) {
  if (ql <= l && qr >= r) {
    num[rt] |= val;
    laze[rt] |= val;
    return;
  }
  pushdown(l, r, rt);
  int mid = (l + r) / 2;
  if (ql <= mid) updata(l, mid, ql, qr, val, rt * 2);
  if (qr > mid) updata(mid + 1, r, ql, qr, val, rt * 2 + 1);
  pushup(l, r, rt);
}
int qry(int l, int r, int ql, int qr, int rt) {
  if (ql <= l && qr >= r) {
    return num[rt];
  }
  pushdown(l, r, rt);
  int mid = (l + r) / 2;
  if (ql <= mid && qr > mid)
    return qry(l, mid, ql, qr, rt * 2) & qry(mid + 1, r, ql, qr, rt * 2 + 1);
  else if (qr > mid)
    return qry(mid + 1, r, ql, qr, rt * 2 + 1);
  else if (ql <= mid)
    return qry(l, mid, ql, qr, rt * 2);
  pushup(l, r, rt);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  build(1, n, 1);
  for (int i = (0); i < (q); i++) {
    cin >> a[i].l >> a[i].r >> a[i].val;
    updata(1, n, a[i].l, a[i].r, a[i].val, 1);
  }
  int flag = 0;
  for (int i = (0); i < (q); i++) {
    if (a[i].val != qry(1, n, a[i].l, a[i].r, 1)) flag = 1;
  }
  if (flag) {
    cout << "NO";
  } else {
    cout << "YES"
         << "\n";
    for (int i = (1); i < (n + 1); i++) {
      cout << qry(1, n, i, i, 1) << " ";
    }
  }
  return 0;
}
