#include <bits/stdc++.h>
int segment[100100 * 4], l[100100], r[100100], q[100100], ans[100100];
bool v[100100 * 4];
int n, m, anss;
void insert(int now, int l, int r, int a, int b, int c) {
  if (b < l || a > r) return;
  if (a <= l && b >= r) {
    if (segment[now] == -1)
      segment[now] = c;
    else
      segment[now] |= c;
    v[now] = true;
    return;
  }
  if (v[now] == true) {
    if (segment[now * 2] == -1)
      segment[now * 2] = segment[now];
    else
      segment[now * 2] |= segment[now];
    if (segment[now * 2 + 1] == -1)
      segment[now * 2 + 1] = segment[now];
    else
      segment[now * 2 + 1] |= segment[now];
    v[now * 2] = true;
    v[now * 2 + 1] = true;
    v[now] = false;
  }
  insert(now * 2, l, (l + r) >> 1, a, b, c);
  insert(now * 2 + 1, ((l + r) >> 1) + 1, r, a, b, c);
}
int ask(int now, int l, int r, int a, int b) {
  if (a > r || b < l) return -1;
  if (a <= l && b >= r) return segment[now];
  if (v[now] == true) {
    if (segment[now * 2] == -1)
      segment[now * 2] = segment[now];
    else
      segment[now * 2] |= segment[now];
    if (segment[now * 2 + 1] == -1)
      segment[now * 2 + 1] = segment[now];
    else
      segment[now * 2 + 1] |= segment[now];
    v[now * 2] = true;
    v[now * 2 + 1] = true;
    v[now] = false;
  }
  int x = ask(now * 2, l, (l + r) >> 1, a, b);
  int y = ask(now * 2 + 1, ((l + r) >> 1) + 1, r, a, b);
  if (segment[now * 2] == -1)
    segment[now] = segment[now * 2 + 1];
  else if (segment[now * 2 + 1] == -1)
    segment[now] = segment[now * 2];
  else
    segment[now] = segment[now * 2] & segment[now * 2 + 1];
  if (x == -1) return y;
  if (y == -1) return x;
  return x & y;
}
int main() {
  int i, now, tmp;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) scanf("%d%d%d", &l[i], &r[i], &q[i]);
  memset(segment, -1, sizeof(segment));
  memset(v, false, sizeof(v));
  for (i = 1; i <= m; i++) insert(1, 1, n, l[i], r[i], q[i]);
  for (i = 1; i <= n; i++) ans[i] = ask(1, 1, n, i, i);
  for (i = 1; i <= m; i++)
    if (ask(1, 1, n, l[i], r[i]) != q[i]) {
      anss = -100100;
      break;
    }
  if (anss == -100100)
    printf("NO\n");
  else {
    printf("YES\n");
    for (i = 1; i <= n; i++)
      if (ans[i] > -1)
        printf("%d ", ans[i]);
      else
        printf("0 ");
  }
}
