#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 10, LG = 30, Non_And = ((1 << 30)) - 1;
int ps[LG][N], n;
pair<pair<int, int>, int> quer[N];
void upd(int l, int r, int bit) {
  ps[bit][r]--;
  ps[bit][l]++;
}
void mdfy(int bit) {
  for (int i = 1; i <= n; i++) ps[bit][i] += ps[bit][i - 1];
  for (int i = 0; i <= n; i++) ps[bit][i] = min(ps[bit][i], 1);
  for (int i = 1; i <= n; i++) ps[bit][i] += ps[bit][i - 1];
}
int get(int l, int r, int bit) {
  if (l == 0) return ps[bit][r];
  return ps[bit][r] - ps[bit][l - 1];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int l, r, q;
    cin >> l >> r >> q;
    l--;
    for (int j = 0; j < LG; j++) {
      if (q & ((long long)1 << j)) {
        upd(l, r, j);
      }
    }
    quer[i].first.first = l;
    quer[i].first.second = r;
    quer[i].second = q;
  }
  for (int j = 0; j < LG; j++) mdfy(j);
  for (int i = 0; i < m; i++) {
    int l, r, k;
    l = quer[i].first.first;
    r = quer[i].first.second;
    k = quer[i].second;
    for (int j = 0; j < LG; j++) {
      if ((k & ((long long)1 << j)) == 0) {
        if (get(l, r - 1, j) == r - l) {
          cout << "NO\n";
          return 0;
        }
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    int ansi = 0;
    for (int j = 0; j < LG; j++) {
      if (get(i, i, j)) ansi += ((long long)1 << j);
    }
    cout << ansi << " ";
  }
  cout << '\n';
}
