#include <bits/stdc++.h>
using namespace std;
struct nod {
  int l, r;
  long long int q;
} nods[100000 + 10];
bool compare(nod x, nod y) {
  if (x.l == y.l) return x.r < y.r;
  return x.l < y.l;
}
long long int ans[100000 + 10];
int bits[35];
int last[35];
long long int p2[35];
long long int segs[5 * 100000 + 10];
void build(int nod, int b, int e) {
  if (b == e) {
    segs[nod] = ans[b];
  } else {
    int mid = (b + e) / 2;
    build(2 * nod + 1, b, mid);
    build(2 * nod + 2, mid + 1, e);
    segs[nod] = segs[2 * nod + 1] & segs[2 * nod + 2];
  }
}
long long int query(int nod, int b, int e, int l, int r) {
  if (b >= l && e <= r) {
    long long int u = segs[nod];
    return u;
  }
  int mid = (b + e) / 2;
  if (r <= mid) {
    long long int u = query(2 * nod + 1, b, mid, l, r);
    return u;
  }
  if (l > mid) {
    long long int u = query(2 * nod + 2, mid + 1, e, l, r);
    return u;
  }
  long long int v1 = query(2 * nod + 1, b, mid, l, r);
  long long int v2 = query(2 * nod + 2, mid + 1, e, l, r);
  long long int v = v1 & v2;
  return v;
}
int main() {
  int i, n, m;
  scanf("%d %d", &n, &m);
  p2[0] = 1;
  for (i = 1; i <= 30; i++) {
    last[i] = 0;
    bits[i] = 0;
    p2[i] = p2[i - 1] + p2[i - 1];
  }
  for (i = 1; i <= m; i++)
    scanf("%d %d %lld", &nods[i].l, &nods[i].r, &nods[i].q);
  sort(nods + 1, nods + m + 1, compare);
  int j = 1;
  for (i = 1; i <= n; i++) {
    while (j <= m && nods[j].l <= i) {
      long long int temp = nods[j].q;
      for (int k = 1; k <= 30; k++) {
        if (temp % 2 == 1) last[k] = max(last[k], nods[j].r);
        temp = temp / 2;
      }
      j++;
    }
    long long int val = 0;
    for (int k = 1; k <= 30; k++) {
      if (last[k] < i)
        bits[k] = 0;
      else
        bits[k] = 1;
      val = val + p2[k - 1] * bits[k];
    }
    ans[i] = val;
  }
  int fl = 1;
  build(0, 1, n);
  for (int i = 1; i <= m; i++) {
    long long int res = query(0, 1, n, nods[i].l, nods[i].r);
    if (res != nods[i].q) {
      fl = 0;
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) {
    printf("%lld ", ans[i]);
  }
  printf("\n");
  return 0;
}
