#include <bits/stdc++.h>
using namespace std;
int x[100005], y[100005], q[100005], ans[100005];
struct segtree {
 private:
  bool tree[100005 << 2];

 public:
  void Clear(int l, int r, int rt) {
    tree[rt] = false;
    if (l == r) return;
    int m = (l + r) >> 1;
    Clear(l, m, rt << 1);
    Clear(m + 1, r, rt << 1 | 1);
  }
  void Pushdown(int rt) {
    if (tree[rt]) tree[rt << 1 | 1] = tree[rt << 1] = true;
  }
  void Pushup(int rt) {
    if (tree[rt << 1 | 1] && tree[rt << 1]) tree[rt] = true;
  }
  void Updata(int L, int R, int l, int r, int rt) {
    if (L <= l && r <= R) {
      tree[rt] = true;
      return;
    }
    Pushdown(rt);
    int m = (l + r) >> 1;
    if (L <= m) Updata(L, R, l, m, rt << 1);
    if (R > m) Updata(L, R, m + 1, r, rt << 1 | 1);
    Pushup(rt);
  }
  void Query(int L, int R, bool &ok, int l, int r, int rt) {
    if (ok || tree[rt]) return;
    if (L <= l && r <= R) {
      if (!tree[rt]) ok = true;
      return;
    }
    Pushdown(rt);
    int m = (l + r) >> 1;
    if (L <= m) Query(L, R, ok, l, m, rt << 1);
    if (R > m) Query(L, R, ok, m + 1, r, rt << 1 | 1);
  }
  void solve(int w, int l, int r, int rt) {
    if (l == r) {
      if (tree[rt]) ans[l] += (1 << w);
      return;
    }
    Pushdown(rt);
    int m = (l + r) >> 1;
    solve(w, l, m, rt << 1);
    solve(w, m + 1, r, rt << 1 | 1);
  }
  void debug(int l, int r, int rt) {
    printf("[%d %d]:%d\n", l, r, (tree[rt] ? 1 : 0));
    if (l == r) return;
    int m = (l + r) >> 1;
    debug(l, m, rt << 1);
    debug(m + 1, r, rt << 1 | 1);
  }
} T[32];
int main() {
  int n, m, i, j, k, w, value;
  bool ok, f;
  scanf("%d%d", &n, &m);
  for (i = 0; i < 32; i++) T[i].Clear(1, n, 1);
  for (i = 1; i <= m; i++) {
    scanf("%d%d%d", &x[i], &y[i], &q[i]);
    for (j = 0; j < 31; j++)
      if (q[i] & (1 << j)) T[j].Updata(x[i], y[i], 1, n, 1);
  }
  for (i = 1; i <= m; i++) {
    for (j = 0; j < 31; j++) {
      if (!(q[i] & (1 << j))) {
        ok = false;
        T[j].Query(x[i], y[i], ok, 1, n, 1);
        if (!ok) {
          printf("NO\n");
          return 0;
        }
      }
    }
  }
  printf("YES\n");
  for (i = 0; i < 31; i++) T[i].solve(i, 1, n, 1);
  for (i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
