#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long INFL = 2e18;
const int N = 1e5 + 5;
int n, m;
pair<pair<int, int>, int> a[N];
int s[N], res[N];
const int SZ_ = 4 * N;
struct intervalTree {
  int L[SZ_], H[SZ_], val[SZ_];
  void build(int x, int lo, int hi) {
    L[x] = lo;
    H[x] = hi;
    if (lo == hi) {
      val[x] = res[lo];
      return;
    }
    int mid = (lo + hi) >> 1;
    build(((x) << 1), lo, mid);
    build((((x) << 1) + 1), mid + 1, hi);
    val[x] = val[((x) << 1)] & val[(((x) << 1) + 1)];
  }
  int query(int x, int lo, int hi) {
    if (L[x] > hi || H[x] < lo) return (1 << 30) - 1;
    if (L[x] >= lo && H[x] <= hi) return val[x];
    return query(((x) << 1), lo, hi) & query((((x) << 1) + 1), lo, hi);
  }
  int query(int lo, int hi) { return query(1, lo, hi); }
} IT;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = (1), _b = (m); i <= _b; ++i) {
    cin >> a[i].first.first >> a[i].first.second >> a[i].second;
  }
  for (int bit = (0), _b = (30); bit < _b; ++bit) {
    for (int i = (0), _b = (n + 1); i <= _b; ++i) s[i] = 0;
    for (int i = (1), _b = (m); i <= _b; ++i) {
      int l = a[i].first.first, r = a[i].first.second, q = a[i].second;
      if ((1 << (bit)) & q) {
        ++s[l];
        --s[r + 1];
      }
    }
    for (int i = (1), _b = (n); i <= _b; ++i) {
      s[i] += s[i - 1];
      if (s[i] > 0) res[i] |= (1 << (bit));
    }
  }
  IT.build(1, 1, n);
  for (int i = (1), _b = (m); i <= _b; ++i) {
    int l = a[i].first.first, r = a[i].first.second, q = a[i].second;
    if (IT.query(l, r) != q) return cout << "NO" << '\n', 0;
  }
  cout << "YES" << '\n';
  for (int i = (1), _b = (n); i <= _b; ++i) cout << res[i] << ' ';
  cout << '\n';
  return 0;
}
