#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, m;
int l[100005], r[100005], x[100005], ans[100005];
struct node {
  int val, tag;
} t[400005];
void pushup(int root) { t[root].val = t[root << 1].val & t[root << 1 | 1].val; }
void pushdown(int root, int l, int r) {
  int x = t[root].tag;
  t[root].tag = 0;
  if (x == 0) return;
  t[root << 1].val |= x, t[root << 1].tag |= x;
  t[root << 1 | 1].val |= x, t[root << 1 | 1].tag |= x;
}
void build(int root, int l, int r) {
  t[root].tag = 0;
  if (l == r) {
    t[root].val = 0;
    return;
  }
  int mid = (l + r) >> 1;
  build(root << 1, l, mid), build(root << 1 | 1, mid + 1, r), pushup(root);
}
void updata(int root, int l, int r, int a, int b, int k) {
  if (l > b || r < a) return;
  if (l >= a && r <= b) {
    t[root].val |= k;
    t[root].tag |= k;
    return;
  }
  int mid = (l + r) >> 1;
  pushdown(root, l, r);
  updata(root << 1, l, mid, a, b, k),
      updata(root << 1 | 1, mid + 1, r, a, b, k), pushup(root);
}
int getand(int root, int l, int r, int a, int b) {
  if (l > b || r < a) return (1ll << 31) - 1;
  if (l >= a && r <= b) return t[root].val;
  int mid = (l + r) >> 1;
  pushdown(root, l, r);
  return getand(root << 1, l, mid, a, b) &
         getand(root << 1 | 1, mid + 1, r, a, b);
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(ans, 0, sizeof(ans));
    build(1, 1, n);
    for (int i = 1; i <= m; i++) {
      l[i] = read(), r[i] = read(), x[i] = read();
      updata(1, 1, n, l[i], r[i], x[i]);
    }
    int flag = 1;
    for (int i = 1; i <= m; i++) {
      int k = getand(1, 1, n, l[i], r[i]);
      if (k != x[i]) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      printf("YES\n");
      for (int i = 1; i <= n; i++) printf("%d ", getand(1, 1, n, i, i));
      printf("\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
