#include <bits/stdc++.h>
using namespace std;
int MOD = 1000000007;
struct S {
  S(int ll, int rr, long qq) : l(ll), r(rr), q(qq) {}
  int l;
  int r;
  long q;
};
int main() {
  int n, m;
  cin >> n >> m;
  vector<S> v;
  for (int i = 0; i < m; ++i) {
    long l, r, q;
    cin >> l >> r >> q;
    v.push_back(S(l - 1, r - 1, q));
  }
  vector<vector<int>> ar(n + 1);
  vector<vector<int>> bigsum(n + 1);
  vector<int> result(n);
  for (int i = 0; i <= n; ++i) {
    ar[i].resize(30);
    bigsum[i].resize(30);
  }
  for (int b = 0; b < 30; ++b) {
    for (int i = 0; i < m; ++i) {
      if ((v[i].q) & (1 << b)) {
        ar[v[i].l][b]++;
        ar[v[i].r + 1][b]--;
      }
    }
  }
  for (int b = 0; b < 30; ++b) {
    int sum = 0;
    for (int i = 0; i < n; ++i) {
      sum += ar[i][b];
      if (sum > 0) result[i] |= (1 << b);
      bigsum[i + 1][b] = bigsum[i][b] + (sum > 0);
    }
  }
  for (int b = 0; b < 30; ++b) {
    for (int i = 0; i < m; ++i) {
      if (!((v[i].q) & (1 << b))) {
        int got = bigsum[v[i].r + 1][b] - bigsum[v[i].l][b];
        int need = v[i].r + 1 - v[i].l;
        if (got == need) {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    cout << result[i] << " ";
  }
}
