#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 5;
const int INF = 0x3f3f3f3f;
int n, m;
int L[MX], R[MX], Q[MX], A[MX];
bool ok[32][MX << 2];
int cnt[32][MX];
void update(int L, int R, int id, int l, int r, int rt) {
  if (L <= l && r <= R) {
    ok[id][rt] = 1;
    return;
  }
  int m = (l + r) >> 1;
  if (L <= m) update(L, R, id, l, m, rt << 1);
  if (R > m) update(L, R, id, m + 1, r, rt << 1 | 1);
}
void build(int l, int r, int rt) {
  if (l == r) {
    for (int i = 0; i <= 30; i++) {
      if (ok[i][rt]) A[l] |= 1 << i;
      cnt[i][l] = cnt[i][l - 1] + ok[i][rt];
    }
    return;
  }
  int m = (l + r) >> 1;
  for (int i = 0; i <= 30; i++) {
    if (ok[i][rt]) {
      ok[i][rt << 1] = ok[i][rt << 1 | 1] = 1;
    }
  }
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &L[i], &R[i], &Q[i]);
    for (int j = 0; j <= 30; j++) {
      if (Q[i] >> j & 1) {
        update(L[i], R[i], j, 1, n, 1);
      }
    }
  }
  build(1, n, 1);
  bool sign = 1;
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j <= 30; j++) {
      if ((Q[i] >> j & 1) == 0) {
        int c = cnt[j][R[i]] - cnt[j][L[i] - 1];
        if (c == R[i] - L[i] + 1) {
          sign = 0;
          break;
        }
      }
    }
    if (!sign) break;
  }
  if (!sign)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      printf("%d%c", A[i], i == n ? '\n' : ' ');
    }
  }
  return 0;
}
