#include <bits/stdc++.h>
using namespace std;
int treeor[400000];
int treeand[400000];
int a[100001];
void modifyor(int v, int tl, int tr, int l, int r, int val) {
  if (l == tl && r == tr)
    treeor[v] |= val;
  else {
    int x = (tl + tr) / 2;
    if (l <= x) modifyor(v * 2, tl, x, l, min(x, r), val);
    if (r >= x + 1) modifyor(v * 2 + 1, x + 1, tr, max(l, x + 1), r, val);
  }
}
int get(int v, int tl, int tr, int num) {
  if (tl == tr)
    return treeor[v];
  else {
    int x = (tl + tr) / 2;
    if (num <= x) {
      treeor[v * 2] |= treeor[v];
      return get(v * 2, tl, x, num);
    } else {
      treeor[v * 2 + 1] |= treeor[v];
      return get(v * 2 + 1, x + 1, tr, num);
    }
  }
}
void init(int v, int tl, int tr) {
  if (tl == tr)
    treeand[v] = a[tl];
  else {
    int x = (tl + tr) / 2;
    init(v * 2, tl, x);
    init(v * 2 + 1, x + 1, tr);
    treeand[v] = treeand[v * 2] & treeand[v * 2 + 1];
  }
}
int getand(int v, int tl, int tr, int l, int r) {
  if (tl == l && tr == r)
    return treeand[v];
  else {
    int x = (tl + tr) / 2;
    if (l <= x && r >= x + 1) {
      int sonl, sonr;
      sonl = getand(v * 2, tl, x, l, x);
      sonr = getand(v * 2 + 1, x + 1, tr, x + 1, r);
      return sonl & sonr;
    } else if (l <= x)
      return getand(v * 2, tl, x, l, r);
    else
      return getand(v * 2 + 1, x + 1, tr, l, r);
  }
}
struct Query {
  int l, r, q;
} q[100000];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  memset(treeor, 0, 1600000);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &q[i].l, &q[i].r, &q[i].q);
    modifyor(1, 1, n, q[i].l, q[i].r, q[i].q);
  }
  for (int i = 1; i <= n; i++) a[i] = get(1, 1, n, i);
  init(1, 1, n);
  bool corr = 1;
  for (int i = 0; i < m; i++)
    if (getand(1, 1, n, q[i].l, q[i].r) != q[i].q) {
      corr = 0;
      break;
    }
  if (corr) {
    printf("YES\n");
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  } else
    printf("NO\n");
  return 0;
}
