#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5;
int n, m, x[N + 10], y[N + 10], z[N + 10];
bool tag[N * 4 + 10][31], bit[N * 4 + 10][31];
inline void down(int k, int i) {
  if (tag[k][i]) {
    tag[k << 1][i] = bit[k << 1][i] = 1;
    tag[k << 1 | 1][i] = bit[k << 1 | 1][i] = 1;
    tag[k][i] = 0;
  }
}
inline void down(int k) {
  for (int i = 0; i <= 30; ++i)
    if (tag[k][i]) {
      tag[k << 1][i] = bit[k << 1][i] = 1;
      tag[k << 1 | 1][i] = bit[k << 1 | 1][i] = 1;
      tag[k][i] = 0;
    }
}
inline void update(int k, int i) {
  bit[k][i] = bit[k << 1][i] && bit[k << 1 | 1][i];
}
inline void update(int k) {
  for (int i = 0; i <= 30; ++i)
    bit[k][i] = bit[k << 1][i] && bit[k << 1 | 1][i];
}
void cover(int k, int lc, int rc, int l, int r, int d) {
  if (l == lc && r == rc) {
    if (bit[k][d]) return;
    bit[k][d] = tag[k][d] = 1;
    return;
  }
  down(k, d);
  int mid = lc + rc >> 1;
  if (r <= mid)
    cover(k << 1, lc, mid, l, r, d);
  else if (l > mid)
    cover(k << 1 | 1, mid + 1, rc, l, r, d);
  else
    cover(k << 1, lc, mid, l, mid, d),
        cover(k << 1 | 1, mid + 1, rc, mid + 1, r, d);
  update(k, d);
}
bool query(int k, int lc, int rc, int l, int r, int d) {
  if (l == lc && r == rc) return bit[k][d];
  down(k, d);
  int mid = lc + rc >> 1;
  if (r <= mid) return query(k << 1, lc, mid, l, r, d);
  if (l > mid) return query(k << 1 | 1, mid + 1, rc, l, r, d);
  return query(k << 1, lc, mid, l, mid, d) &&
         query(k << 1 | 1, mid + 1, rc, mid + 1, r, d);
}
int query(int k, int lc, int rc, int p) {
  if (lc == rc) {
    int t = 0;
    for (int i = 30; i >= 0; --i) t = t * 2 + bit[k][i];
    return t;
  }
  down(k);
  int mid = lc + rc >> 1;
  if (p <= mid)
    return query(k << 1, lc, mid, p);
  else
    return query(k << 1 | 1, mid + 1, rc, p);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d%d", &x[i], &y[i], &z[i]);
    for (int j = 0, k = z[i]; k; k /= 2, ++j)
      if (k & 1) cover(1, 1, n, x[i], y[i], j);
  }
  for (int i = 1; i <= m; ++i)
    for (int j = 0; j <= 30; ++j)
      if ((z[i] & 1 << j) == 0 && query(1, 1, n, x[i], y[i], j))
        puts("NO"), exit(0);
  puts("YES");
  for (int i = 1; i <= n; ++i)
    printf("%d%c", query(1, 1, n, i), i == n ? '\n' : ' ');
  return 0;
}
