#include <bits/stdc++.h>
using namespace std;
int value[101000 * 4], f[101000], l[101000], r[101000], q[101000];
void insert(int p, int L, int R, int l, int r, int q) {
  if (L == l && R == r) {
    value[p] |= q;
    return;
  }
  int mid = (L + R) >> 1;
  if (r <= mid)
    insert(p << 1, L, mid, l, r, q);
  else if (l > mid)
    insert(p * 2 + 1, mid + 1, R, l, r, q);
  else {
    insert(p << 1, L, mid, l, mid, q);
    insert(p * 2 + 1, mid + 1, R, mid + 1, r, q);
  }
}
int find(int p, int L, int R, int l, int r) {
  if (L == l && R == r) return value[p];
  int mid = (L + R) >> 1;
  if (r <= mid)
    return find(p << 1, L, mid, l, r) | value[p];
  else if (l > mid)
    return find(p * 2 + 1, mid + 1, R, l, r) | value[p];
  else
    return (find(p << 1, L, mid, l, mid) &
            find(p * 2 + 1, mid + 1, R, mid + 1, r)) |
           value[p];
}
int get(int p, int L, int R, int l, int r) {
  if (L == l && R == r) return value[p];
  int mid = (L + R) >> 1;
  if (r <= mid)
    return get(p << 1, L, mid, l, r) | value[p];
  else
    return get(p * 2 + 1, mid + 1, R, l, r) | value[p];
}
inline void read(int &x) {
  x = 0;
  char ch;
  while (ch = getchar(), ch > '9' || ch < '0')
    ;
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
}
int main() {
  int n, m;
  read(n), read(m);
  for (int i = 1; i <= m; i++) {
    read(l[i]), read(r[i]), read(q[i]);
    insert(1, 1, n, l[i], r[i], q[i]);
  }
  int i;
  for (i = 1; i <= m; i++)
    if (find(1, 1, n, l[i], r[i]) != q[i]) break;
  if (i <= m)
    printf("NO\n");
  else {
    printf("YES\n");
    printf("%d", get(1, 1, n, 1, 1));
    for (int i = 2; i <= n; i++) printf(" %d", get(1, 1, n, i, i));
    printf("\n");
  }
  return 0;
}
