#include <bits/stdc++.h>
using namespace std;
int ts, kk = 1;
template <class T>
inline T _sq(T a) {
  return a * a;
}
template <class T, class X>
inline T _pow(T a, X y) {
  T z = 1;
  for (int i = 1; i <= y; i++) {
    z *= a;
  }
  return z;
}
template <class T>
inline T _gcd(T a, T b) {
  a = _abs(a);
  b = _abs(b);
  if (!b) return a;
  return _gcd(b, a % b);
}
template <class T>
inline T _lcm(T a, T b) {
  a = _abs(a);
  b = _abs(b);
  return (a / _gcd(a, b)) * b;
}
template <class T>
inline T _extended(T a, T b, T &x, T &y) {
  a = _abs(a);
  b = _abs(b);
  T g, x1, y1;
  if (!b) {
    x = 1;
    y = 0;
    g = a;
    return g;
  }
  g = _extended(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
template <class T, class X>
inline bool getbit(T a, X i) {
  T t = 1;
  return ((a & (t << i)) > 0);
}
template <class T, class X>
inline T setbit(T a, X i) {
  T t = 1;
  return (a | (t << i));
}
template <class T, class X>
inline T resetbit(T a, X i) {
  T t = 1;
  return (a & (~(t << i)));
}
template <class T, class X>
inline T togglebit(T a, X i) {
  T t = 1;
  return (a ^ (t << i));
}
template <class T, class X, class Y>
inline T _bigmod(T n, X m, Y mod) {
  unsigned long long ret = 1, a = n % mod;
  while (m) {
    if (m & 1) ret = (ret * a) % mod;
    m >>= 1;
    a = (a * a) % mod;
  }
  ret %= mod;
  return (T)ret;
}
template <class T, class Y>
inline T _modinv(T n, Y mod) {
  return _bigmod(n, mod - 2, mod);
}
int a[(100000 + 20)], b[(100000 + 20)], ans[4 * (100000 + 20)];
struct DT {
  int r, l, q;
  void set(int lf, int rr, int qq) { r = rr, l = lf, q = qq; }
} op[(100000 + 20)];
void update(int idx, int st, int ed, int s, int e, int val) {
  if (st == s && ed == e) {
    ans[idx] |= val;
    return;
  }
  int mid = (st + ed) / 2;
  if (mid >= e)
    update((idx << 1), st, mid, s, e, val);
  else if (mid < s) {
    update((idx << 1) + 1, mid + 1, ed, s, e, val);
  } else {
    update((idx << 1), st, mid, s, mid, val);
    update((idx << 1) + 1, mid + 1, ed, mid + 1, e, val);
  }
  return;
}
void build(int idx, int st, int ed, int val) {
  if (st == ed) {
    ans[idx] |= val;
    return;
  }
  int mid = (st + ed) / 2;
  build(2 * idx, st, mid, val | ans[idx]);
  build(2 * idx + 1, mid + 1, ed, val | ans[idx]);
  ans[idx] = ans[2 * idx] & ans[2 * idx + 1];
}
int query(int idx, int st, int ed, int s, int e) {
  if (st == s && ed == e) {
    return ans[idx];
  }
  int ret;
  int mid = (st + ed) / 2;
  if (mid >= e) {
    return query((idx << 1), st, mid, s, e);
  } else if (s > mid) {
    return query((idx << 1) + 1, mid + 1, ed, s, e);
  } else {
    int r1 = query((idx << 1), st, mid, s, mid);
    int r2 = query((idx << 1) + 1, mid + 1, ed, mid + 1, e);
    ret = r1 & r2;
  }
  return ret;
}
int main() {
  int n, m, l, r, q;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> l >> r >> q;
    op[i].set(l, r, q);
    update(1, 1, n, l, r, q);
  }
  build(1, 1, n, 0);
  bool chk = true;
  for (int i = 1; i <= m; i++) {
    if (op[i].q != query(1, 1, n, op[i].l, op[i].r)) {
      chk = false;
      break;
    }
  }
  if (chk) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      if (i - 1) cout << " ";
      cout << query(1, 1, n, i, i);
    }
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
