#include <bits/stdc++.h>
using namespace std;
const char lend = '\n';
const int N = 100000, M = 30;
int vet[N][M], n, m, l[N], r[N], x[N];
void first(int b) {
  set<int> s;
  for (int i = 0; i < n; ++i) s.insert(i);
  for (int i = 0; i < m; ++i)
    if (x[i] >> b & 1) {
      auto it = s.lower_bound(l[i]);
      while (it != s.end() && *it <= r[i]) {
        vet[*it][b] = 1;
        s.erase(it++);
      }
    }
}
int second(int b) {
  vector<int> s;
  for (int i = 0; i < n; ++i)
    if (!vet[i][b]) s.push_back(i);
  for (int i = 0; i < m; ++i)
    if (!(x[i] >> b & 1)) {
      auto it = lower_bound(s.begin(), s.end(), l[i]);
      if (it == s.end() || *it > r[i]) return 0;
    }
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) cin >> l[i] >> r[i] >> x[i], --l[i], --r[i];
  bool g = 1;
  for (int i = 0; i < M; ++i) first(i);
  for (int i = 0; i < M && g; ++i) g &= second(i);
  if (!g)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 0; i < n; ++i) {
      int k = 0;
      for (int j = 0; j < M; ++j)
        if (vet[i][j]) k += 1 << j;
      cout << (i ? " " : "") << k;
    }
    cout << lend;
  }
}
