#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int c[32][maxn];
int l[maxn];
int r[maxn];
int q[maxn];
int n;
int main(void) {
  memset(c, 0, sizeof(c));
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &l[i], &r[i], &q[i]);
    int x = q[i];
    for (int j = 0; j < 30; j++) {
      if ((x >> j) & 1) {
        c[j][l[i]]++;
        c[j][r[i] + 1]--;
      }
    }
  }
  for (int i = 0; i < 30; i++) {
    for (int j = 1; j <= n; j++) c[i][j] += c[i][j - 1];
    for (int j = 1; j <= n; j++)
      if (c[i][j]) c[i][j] = 1;
    for (int j = 1; j <= n; j++) c[i][j] += c[i][j - 1];
  }
  bool flag = true;
  for (int i = 1; i <= m; i++) {
    int len = r[i] - l[i] + 1;
    int x = 0;
    for (int j = 0; j < 30; j++) {
      if (c[j][r[i]] - c[j][l[i] - 1] == len) {
        x |= (1 << j);
      }
    }
    if (x != q[i]) {
      flag = false;
      break;
    }
  }
  if (flag == false)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      int x = 0;
      for (int j = 0; j < 30; j++) {
        if (c[j][i] - c[j][i - 1]) {
          x |= (1 << j);
        }
      }
      printf("%d%c", x, (i == n) ? '\n' : ' ');
    }
  }
  return 0;
}
