#include <bits/stdc++.h>
using namespace std;
int s[31][100003];
int bit[31][100003];
int countzero[31][100003];
int main() {
  int n, m;
  cin >> n >> m;
  int l[m], r[m], q[m];
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    for (int j = 0; j < 30; j++) {
      if (q[i] & (1 << j)) {
        s[j][l[i]]++;
        s[j][r[i] + 1]--;
      }
    }
  }
  for (int i = 0; i < 30; i++) {
    int count = 0;
    countzero[i][0] = 0;
    for (int j = 1; j <= n; j++) {
      count += s[i][j];
      if (count > 0) {
        bit[i][j] = 1;
      } else {
        bit[i][j] = 0;
      }
      countzero[i][j] = countzero[i][j - 1] + (bit[i][j] == 0);
    }
  }
  bool res = true;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < 30; j++) {
      if (!(q[i] & (1 << j))) {
        if (countzero[j][r[i]] - countzero[j][l[i] - 1] <= 0) {
          res = false;
          goto df;
        }
      }
    }
  }
df:
  if (res) {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) {
      int res = 0;
      for (int j = 29; j >= 0; j--) {
        res *= 2;
        res += bit[j][i];
      }
      cout << res << " ";
    }
  } else
    cout << "NO";
}
