#include <bits/stdc++.h>
using namespace std;
struct T {
  int x;
  T() { x = -1; }
  T(int _x) { x = _x; }
};
T operator+(const T &L, const T &R) {
  if (L.x == -1) return R;
  if (R.x == -1) return L;
  return T(L.x | R.x);
}
T operator-(const T &L, const T &R) {
  if (L.x == -1) return R;
  if (R.x == -1) return L;
  return T(L.x & R.x);
}
struct LazyPropagation {
  vector<T> v;
  int N;
  void sz(int x) {
    N = 1;
    while (N < x) N <<= 1;
    v.resize(N << 1, T());
  }
  void add(int pos, T x) { v[N + pos] = x; }
  T query(int pos) {
    T ans = T((1 << 30) - 1);
    for (pos += N; pos > 0; pos >>= 1) ans = ans - v[pos];
    return ans;
  }
  void update(int l, int r, T &x) {
    for (l += N, r += N; l < r; l >>= 1, r >>= 1) {
      if (l & 1) v[l] = v[l++] + x;
      if (r & 1) v[--r] = v[r] + x;
    }
  }
  void Flush() {
    for (int i = 1; i < N; i++) {
      v[i << 1] = v[i << 1] + v[i];
      v[i << 1 | 1] = v[i << 1 | 1] + v[i];
      v[i] = -1;
    }
  }
};
struct SegmentTree {
  vector<T> v;
  int N;
  void sz(int x) {
    N = 1;
    while (N < x) N <<= 1;
    v.assign(N << 1, T());
  }
  void add(int pos, T x) { v[N + pos] = x; }
  void build() {
    for (int i = N - 1; i > 0; i--) v[i] = v[i << 1] - v[i << 1 | 1];
  }
  T query(int l, int r) {
    T ans1 = T(), ans2 = T();
    for (l += N, r += N; l < r; l >>= 1, r >>= 1) {
      if (l & 1) ans1 = ans1 - v[l++];
      if (r & 1) ans2 = v[--r] - ans2;
    }
    return ans1 - ans2;
  }
  void update(int pos, T x) {
    for (v[pos + N] = x, pos = (pos + N) >> 1; pos > 0; pos >>= 1)
      v[pos] = v[pos << 1] + v[pos << 1 | 1];
  }
};
vector<pair<int, pair<int, int> > > res;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  LazyPropagation H;
  H.sz(n);
  for (int i = 0; i < m; i++) {
    int l, r, q;
    cin >> l >> r >> q;
    res.push_back({l, {r, q}});
    T xx = T(q);
    H.update(l - 1, r, xx);
  }
  H.Flush();
  SegmentTree P;
  P.sz(n);
  for (int i = 0; i < n; i++) P.add(i, H.v[H.N + i].x);
  P.build();
  for (auto a : res) {
    if (P.query(a.first - 1, a.second.first).x == a.second.second) {
      continue;
    } else {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++) {
    if (H.v[H.N + i].x == -1)
      cout << ((1 << 30) - 1) << " ";
    else
      cout << H.v[H.N + i].x << " ";
  }
  cout << '\n';
  return 0;
}
