#include <bits/stdc++.h>
struct sequence {
  int t[100010], s[100010];
  inline void insert(int l, int r) {
    t[l]++;
    t[r + 1]--;
  }
  inline void modify(int n) {
    for (int i = 1; i <= n; i++) t[i] += t[i - 1];
    for (int i = 1; i <= n; i++) t[i] = t[i] > 0;
    for (int i = 1; i <= n; i++) s[i] = s[i - 1] + t[i];
  }
  inline bool query(int l, int r) {
    int now = s[r] - s[l - 1];
    if (now == r - l + 1)
      return 0;
    else
      return 1;
  }
  inline bool query(int pos) { return t[pos]; }
} t[32];
int a[100010];
int l[100010], r[100010], q[100010];
int main() {
  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]);
  for (int i = 1; i <= m; i++)
    for (int j = 0; j < 30; j++)
      if (q[i] & (1 << j)) t[j].insert(l[i], r[i]);
  for (int i = 0; i < 30; i++) t[i].modify(n);
  bool flag = 1;
  for (int i = 1; i <= m; i++)
    for (int j = 0; j < 30; j++)
      if (!(q[i] & (1 << j))) flag &= t[j].query(l[i], r[i]);
  if (!flag)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; i++)
      for (int j = 0; j < 30; j++)
        if (t[j].query(i)) a[i] |= 1 << j;
    for (int i = 1; i < n; i++) printf("%d ", a[i]);
    printf("%d\n", a[n]);
  }
  return 0;
}
