#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, inf = 2e9 + 10;
int seg[4 * N], flag[4 * N], l[N], r[N], q[N];
inline void relax(int ind) {
  int x = flag[ind];
  if (!x) return;
  flag[ind] = 0;
  seg[2 * ind] |= x;
  flag[2 * ind] |= x;
  seg[2 * ind + 1] |= x;
  flag[2 * ind + 1] |= x;
}
int query(int s, int e, int ind, int l, int r) {
  if (s >= l && e <= r) return seg[ind];
  relax(ind);
  int mid = (s + e) / 2;
  int ret = (1 << 30) - 1;
  if (mid > l) ret &= query(s, mid, 2 * ind, l, r);
  if (mid < r) ret &= query(mid, e, 2 * ind + 1, l, r);
  return ret;
}
void add(int s, int e, int ind, int l, int r, int val) {
  if (s >= l && e <= r) {
    seg[ind] |= val;
    flag[ind] |= val;
    return;
  }
  relax(ind);
  int mid = (s + e) / 2;
  if (mid > l) add(s, mid, 2 * ind, l, r, val);
  if (mid < r) add(mid, e, 2 * ind + 1, l, r, val);
  seg[ind] = seg[2 * ind] & seg[2 * ind + 1];
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    l[i]--;
    add(0, n, 1, l[i], r[i], q[i]);
  }
  for (int i = 0; i < m; i++) {
    if (query(0, n, 1, l[i], r[i]) != q[i]) return cout << "NO", 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << query(0, n, 1, i, i + 1) << " ";
  return 0;
}
