#include <bits/stdc++.h>
using namespace std;
struct block {
  long long l, r, q;
};
vector<long long> tree, ans;
void build(long long l, long long r, long long idx) {
  if (l == r) {
    tree[idx] = ans[l];
    return;
  }
  long long m = (l + r) / 2;
  build(l, m, 2 * idx);
  build(m + 1, r, 2 * idx + 1);
  tree[idx] = tree[2 * idx] & tree[2 * idx + 1];
}
long long query(long long ql, long long qr, long long l, long long r,
                long long idx) {
  if (ql > qr) return (1ll << 30) - 1;
  if (ql == l && qr == r) return tree[idx];
  long long m = (l + r) / 2;
  long long left = query(ql, min(m, qr), l, m, 2 * idx);
  long long right = query(max(ql, m + 1), qr, m + 1, r, 2 * idx + 1);
  return left & right;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  tree.resize(4 * n + 1);
  ans.resize(n + 1, 0);
  vector<block> v;
  vector<vector<long long> > set_bit(n + 1, vector<long long>(30, 0));
  for (long long i = 0; i < m; i++) {
    long long l, r, q;
    cin >> l >> r >> q;
    v.push_back({l - 1, r - 1, q});
    long long mask = 0;
    while (q) {
      if (q & 1) {
        set_bit[l - 1][mask]++;
        set_bit[r][mask]--;
      }
      mask++;
      q >>= 1;
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < 30; j++) {
      if (i > 0) set_bit[i][j] += set_bit[i - 1][j];
      if (set_bit[i][j]) ans[i] |= (1 << j);
    }
  }
  build(0, n - 1, 1);
  bool ok = true;
  for (long long i = 0; i < m; i++) {
    long long c = query(v[i].l, v[i].r, 0, n - 1, 1);
    if (c != v[i].q) {
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << "YES\n";
    for (long long i = 0; i < n; i++) cout << ans[i] << " ";
  } else
    cout << "NO\n";
  return 0;
}
