#include <bits/stdc++.h>
using namespace std;
int p[100005];
int add[100005];
int f[100005];
int first[100005], second[100005], x[100005];
int find(int x) { return f[x] == x ? x : f[x] = find(f[x]); }
int read() {
  int s = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s;
}
int main() {
  int n = read(), m = read(), i, j, k;
  for (i = 0; i < m; i++) first[i] = read(), second[i] = read(), x[i] = read();
  for (i = 0; i <= 30; i++) {
    for (j = 1; j <= n + 1; j++) f[j] = j, p[j] = 0;
    for (j = 0; j < m; j++)
      if ((x[j] & (1 << i)) >> i)
        for (k = find(first[j]); k <= second[j]; k = find(f[k]))
          p[k] = 1, f[k] = f[k + 1];
    for (j = 1; j <= n; j++) add[j] += p[j] * (1 << i), p[j] += p[j - 1];
    for (j = 0; j < m; j++)
      if (!((x[j] & (1 << i)) >> i))
        if (p[second[j]] - p[first[j] - 1] == second[j] - first[j] + 1) {
          cout << "NO";
          return 0;
        }
  }
  puts("YES");
  for (i = 1; i <= n; i++) printf("%d ", add[i]);
}
