#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops")
const int N = 2e5 + 5;
const long long int mod = 1e9 + 7;
const long long int Mod = 998244353;
const long double Pi = acos(-1);
const long long int Inf = 4e18;
using namespace std;
vector<int> a;
struct SegmentTree {
  vector<int> t;
  int n;
  void Initialize(int n) {
    this->n = 2 * n;
    t.resize(2 * n);
    for (int i = 0; i < n; i++) Update(i, 0, 0, n - 1);
  }
  void Update(int idx, int v, int tl, int tr) {
    if (tl == tr) {
      t[v] = a[idx];
    } else {
      int tm = (tl + tr) >> 1;
      if (idx <= tm)
        Update(idx, 2 * v + 1, tl, tm);
      else
        Update(idx, 2 * v + 2, tm + 1, tr);
      t[v] = (t[2 * v + 1] & t[2 * v + 2]);
    }
  }
  int And(int v, int tl, int tr, int l, int r) {
    if (tl > tr) return 0;
    if (tl == l && tr == r) return t[v];
    int tm = (tl + tr) >> 1;
    if (l > tm)
      return And(2 * v + 2, tm + 1, tr, l, r);
    else if (r <= tm)
      return And(2 * v + 1, tl, tm, l, r);
    else
      return (And(2 * v + 1, tl, tm, l, tm) &
              And(2 * v + 2, tm + 1, tr, tm + 1, r));
  }
};
void TestCase() {
  int n, m, k;
  cin >> n >> m;
  vector<vector<int> > g(n + 1, vector<int>(35, 0));
  vector<pair<pair<int, int>, int> > c(m);
  bitset<32> Bit(n);
  int msb = 0;
  for (int i = 0; i < 32; i++) {
    if (Bit[i]) msb = max(msb, i);
  }
  if (n & (n - 1))
    k = (1 << (msb + 1));
  else
    k = n;
  a.assign(k, 0);
  for (int i = 0, l, r, q; i < m; i++) {
    cin >> l >> r >> q;
    l--;
    r--;
    c[i] = {{l, r}, q};
    bitset<32> Bit(q);
    for (int j = 31; j >= 0; j--) {
      if (Bit[j]) {
        g[l][j]++;
        g[r + 1][j]--;
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    if (i - 1 >= 0) {
      for (int j = 0; j < 31; j++) g[i][j] += g[i - 1][j];
    }
    for (int j = 0; j < 31; j++) {
      if (g[i][j]) a[i] = (a[i] | (1 << j));
    }
  }
  bool ok = true;
  struct SegmentTree sgmt;
  sgmt.Initialize(k);
  for (int i = 0; i < m; i++) {
    if (sgmt.And(0, 0, k - 1, c[i].first.first, c[i].first.second) !=
        c[i].second)
      ok = false;
  }
  if (ok) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << a[i] << " ";
  } else
    cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int T = 1;
  while (T--) {
    TestCase();
  }
  return 0;
}
