#include <bits/stdc++.h>
using namespace std;
int n, m;
int l[112345], r[112345], q[112345];
int prefix[31][112345], s[31][112345], cnt[31][112345];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) cin >> l[i] >> r[i] >> q[i];
  for (int i = 0; i < m; ++i) {
    for (int bit = 0; bit < 31; ++bit) {
      if (q[i] & (1 << bit)) {
        s[bit][l[i]]++;
        s[bit][r[i] + 1]--;
      }
    }
  }
  for (int bit = 0; bit < 31; ++bit) {
    for (int i = 1; i <= n; ++i) {
      prefix[bit][i] = prefix[bit][i - 1] + s[bit][i];
      cnt[bit][i] = cnt[bit][i - 1];
      if (prefix[bit][i] > 0) cnt[bit][i]++;
    }
  }
  for (int i = 0; i < m; ++i) {
    for (int bit = 0; bit < 31; ++bit) {
      if (!(q[i] & (1 << bit))) {
        if (cnt[bit][r[i]] - cnt[bit][l[i] - 1] == r[i] - l[i] + 1) {
          cout << "NO\n";
          return 0;
        }
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; ++i) {
    int digit = 0;
    for (int bit = 0; bit < 31; ++bit) {
      if (prefix[bit][i]) {
        digit += (1 << bit);
      }
    }
    if (i > 1) cout << " ";
    cout << digit;
  }
  cout << endl;
  return 0;
}
