#include <bits/stdc++.h>
using namespace std;
void update(vector<int> &BIT, int value, int index) {
  int n = BIT.size() - 1;
  while (index <= n) {
    BIT[index] += value;
    index += index & (-index);
  }
}
int query(vector<int> &BIT, int index) {
  int sum = 0;
  while (index > 0) {
    sum += BIT[index];
    index -= index & (-index);
  }
  return sum;
}
int query(vector<int> &BIT, int l, int r) {
  return query(BIT, r) - query(BIT, l - 1);
}
const int N = 30;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > arr(n + 1, vector<int>(N, 0));
  bool ok = true;
  int l, r, q;
  vector<pair<pair<int, int>, int> > ops(m);
  for (int i = 0; i < m; i++) {
    cin >> l >> r >> q;
    l--, r--;
    ops[i] = make_pair(make_pair(l, r), q);
    for (int j = 0; j < N; j++) {
      if (q >> j & 1) {
        arr[l][j] += 1;
        arr[r + 1][j] -= 1;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < n; j++) {
      arr[j + 1][i] += arr[j][i];
      arr[j][i] = !!arr[j][i];
    }
  }
  vector<vector<int> > BITS(N, vector<int>(n + 1));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < n; j++) {
      update(BITS[i], arr[j][i], j + 1);
    }
  }
  for (int i = 0; i < m; i++) {
    l = ops[i].first.first, r = ops[i].first.second, q = ops[i].second;
    for (int j = 0; j < N; j++) {
      if (!(q >> j & 1)) {
        ok &= (query(BITS[j], l + 1, r + 1) < (r - l + 1));
      }
    }
  }
  if (!ok)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      int val = 0;
      for (int j = 0; j < N; j++) {
        if (arr[i][j]) val |= 1 << j;
      }
      cout << val << ' ';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
