#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
struct node {
  long long l, r, q;
};
void test_case() {
  long long n, m;
  cin >> n >> m;
  vector<long long> arr(n);
  vector<node> query(m);
  vector<vector<long long> > bit(n + 1, vector<long long>(31));
  for (long long i = 0; i < m; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    --a, --b;
    query[i] = {a, b, c};
    for (long long bi = 0; bi < 31; bi++) {
      if (c & (1 << bi)) {
        bit[a][bi] += 1, bit[b + 1][bi] -= 1;
      }
    }
  }
  for (long long i = 0; i < 31; i++) {
    for (long long j = 0; j < n; j++) {
      bit[j + 1][i] += bit[j][i];
      if (bit[j][i]) {
        arr[j] = arr[j] | (1 << i);
      }
    }
  }
  vector<long long> seg(2 * n + 5);
  for (long long i = 0; i < n; i++) seg[i + n] = arr[i];
  for (long long i = n - 1; i > 0; i--) seg[i] = (seg[2 * i] & seg[2 * i + 1]);
  for (long long i = 0; i < m; i++) {
    long long l = query[i].l + n, r = query[i].r + n;
    long long val = (1 << 30) - 1;
    while (l <= r) {
      if (l & 1) val = val & seg[l++];
      if (!(r & 1)) val = val & seg[r--];
      l /= 2, r /= 2;
    }
    if (val != query[i].q) {
      cout << "NO";
      return;
    }
  }
  cout << "YES\n";
  for (long long i = 0; i < n; i++) cout << arr[i] << " ";
}
signed main() {
  long long t = 1;
  while (t--) test_case();
}
