#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int inf = 1e17;
const long long int N = 1e5 + 5, M = 32;
long long int mark[M][N];
long long int arr[N];
long long int sum[M][N];
long long int l[N], r[N], val[N];
long long int tree[4 * N];
long long int merge(long long int a, long long int b) { return (a & b); }
void build(long long int tv, long long int tl, long long int tr) {
  if (tl == tr) {
    tree[tv] = arr[tl];
    return;
  }
  long long int tm = (tl + tr) / 2;
  build(tv * 2, tl, tm);
  build(tv * 2 + 1, tm + 1, tr);
  tree[tv] = merge(tree[tv * 2], tree[tv * 2 + 1]);
}
long long int query(long long int tv, long long int tl, long long int tr,
                    long long int l, long long int r) {
  if (tl > r or tr < l) {
    return (1LL << 32) - 1;
  }
  if (l <= tl and r >= tr) {
    return tree[tv];
  }
  long long int tm = (tl + tr) / 2;
  long long int p1 = query(tv * 2, tl, tm, l, r);
  long long int p2 = query(tv * 2 + 1, tm + 1, tr, l, r);
  return merge(p1, p2);
}
void __solve() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 1; i <= m; i++) {
    cin >> l[i] >> r[i] >> val[i];
  }
  for (long long int j = 0; j < M; j++) {
    for (long long int i = 1; i <= m; i++) {
      if (val[i] & (1LL << j)) {
        mark[j][l[i]]++;
        mark[j][r[i] + 1]--;
      }
    }
    for (long long int i = 1; i <= n; i++) {
      mark[j][i] += mark[j][i - 1];
    }
    for (long long int i = 1; i <= n; i++) {
      if (mark[j][i]) {
        arr[i] |= (1LL << j);
      }
    }
  }
  build(1, 1, n);
  for (long long int i = 1; i <= m; i++) {
    if (query(1, 1, n, l[i], r[i]) != val[i]) {
      cout << "NO";
      return;
    }
  }
  cout << "YES" << '\n';
  for (long long int i = 1; i <= n; i++) {
    cout << arr[i] << ' ';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) {
    __solve();
    cout << '\n';
  }
}
