#include <bits/stdc++.h>
using namespace std;
int t[400000 + 5], n, m, atas[100003], bawah[100003], nilai[100003],
    haha[33][100003], a[100003];
bool ada;
void build(int node, int l, int r) {
  if (l == r) {
    t[node] = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(2 * node, l, mid);
  build(2 * node + 1, mid + 1, r);
  t[node] = t[2 * node] & t[2 * node + 1];
}
int query(int node, int l, int r, int le, int ri) {
  if (l >= le && r <= ri) return t[node];
  int mid = (l + r) >> 1;
  if (ri <= mid)
    return query(2 * node, l, mid, le, ri);
  else if (le > mid)
    return query(2 * node + 1, mid + 1, r, le, ri);
  else {
    int lefty = query(2 * node, l, mid, le, ri);
    int righty = query(2 * node + 1, mid + 1, r, le, ri);
    return lefty & righty;
  }
}
int main(void) {
  scanf("%d%d", &n, &m);
  memset(haha, 0, sizeof(haha));
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &atas[i], &bawah[i], &nilai[i]);
    for (int j = 0; j <= 30; j++)
      if ((nilai[i] & (1 << j)) > 0) {
        haha[j][atas[i]]++;
        haha[j][bawah[i] + 1]--;
      }
  }
  memset(a, 0, sizeof(a));
  for (int i = 0; i <= 30; i++)
    for (int j = 1; j <= n; j++) {
      haha[i][j] += haha[i][j - 1];
      if (haha[i][j] > 0) a[j] += (1 << i);
    }
  build(1, 1, n);
  ada = true;
  for (int i = 1; i <= m; i++) {
    if (query(1, 1, n, atas[i], bawah[i]) != nilai[i]) {
      ada = false;
      break;
    }
  }
  if (ada == false)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      printf("%d", a[i]);
      if (i < n)
        printf(" ");
      else
        printf("\n");
    }
  }
}
