#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> ors[32], lastZero[32], a, l, r, q;
  int n, m;
  cin >> n >> m;
  a.resize(n + 1);
  for (__typeof(32) i = 0; i < 32; ++i)
    ors[i].resize(n + 2), lastZero[i].resize(n + 1);
  l.resize(m), r.resize(m), q.resize(m);
  for (__typeof(m) p = 0; p < m; ++p) {
    cin >> l[p] >> r[p] >> q[p];
    for (__typeof(32) i = 0; i < 32; ++i)
      if ((q[p] >> i) & 1) ors[i][l[p]]++, ors[i][r[p] + 1]--;
  }
  for (__typeof(32) i = 0; i < 32; ++i) {
    int cur = 0, zero = 0;
    for (__typeof(n) p = 1; p <= n; ++p) {
      cur += ors[i][p];
      if (cur == 0)
        zero = p;
      else
        a[p] |= 1 << i;
      lastZero[i][p] = zero;
    }
  }
  for (__typeof(m) p = 0; p < m; ++p) {
    for (__typeof(32) i = 0; i < 32; ++i) {
      if ((q[p] >> i) & 1) continue;
      if (lastZero[i][r[p]] < l[p]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (__typeof(n) p = 1; p <= n; ++p) cout << a[p] << " ";
  return 0;
}
