#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
int CNT_ = 0;
const long long mod = 1e9 + 7;
const long long maxn = 1e5 + 100;
const long long neutro = (1LL << 30) - 1;
long long st[maxn * 4];
long long vet[maxn];
long long aux[maxn];
void build(long long no, long long l, long long r) {
  if (l == r) {
    st[no] = vet[l];
  } else {
    build((no * 2), l, ((l + r) / 2));
    build(((no * 2) + 1), ((l + r) / 2) + 1, r);
    st[no] = st[(no * 2)] & st[((no * 2) + 1)];
  }
}
long long query(long long no, long long l, long long r, long long posl,
                long long posr) {
  if (l > posr || r < posl) return neutro;
  if (l >= posl && r <= posr) return st[no];
  return query((no * 2), l, ((l + r) / 2), posl, posr) &
         query(((no * 2) + 1), ((l + r) / 2) + 1, r, posl, posr);
}
long long li[maxn], ri[maxn], qi[maxn];
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long cnt = 0; cnt < m; ++cnt) {
    cin >> li[cnt] >> ri[cnt] >> qi[cnt];
    li[cnt]--;
    ri[cnt]--;
  }
  for (long long bit = 0; bit < 30; ++bit) {
    memset(aux, 0, sizeof aux);
    for (long long i = 0; i < m; ++i) {
      if ((qi[i] >> bit) & 1) {
        aux[li[i]]++;
        aux[ri[i] + 1]--;
      }
    }
    for (long long i = 0; i < n; ++i) {
      if (i) aux[i] += aux[i - 1];
      if (aux[i] > 0) vet[i] |= (1LL << bit);
    }
  }
  build(1, 0, n - 1);
  for (long long i = 0; i < m; ++i) {
    if (query(1, 0, n - 1, li[i], ri[i]) != qi[i]) {
      cout << "NO\n";
      exit(0);
    }
  }
  cout << "YES\n";
  for (long long i = 0; i < n; ++i) {
    cout << vet[i] << ' ';
  }
  cout << '\n';
  return 0;
}
