#include <bits/stdc++.h>
using namespace std;
const int N = 100010, D = 30;
int n, m, c[D], a[N];
int l[N], r[N], q[N], s[N][D];
vector<int> p[N], k[N];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d %d", &l[i], &r[i], &q[i]);
    p[l[i]].push_back(q[i]);
    k[r[i]].push_back(q[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (auto j : p[i])
      for (int t = 0; t < D; t++) c[t] += 1 & (j >> t);
    for (int j = 0; j < D; j++)
      if (c[j] > 0) a[i] |= 1 << j;
    for (auto j : k[i])
      for (int t = 0; t < D; t++) c[t] -= 1 & (j >> t);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < D; j++) {
      s[i][j] = s[i - 1][j];
      if (!(1 & (a[i] >> j))) s[i][j]++;
    }
  for (int i = 1; i <= m; i++) {
    bool f = true;
    for (int j = 0; j < D; j++)
      if (!(1 & (q[i] >> j)) && !(s[r[i]][j] - s[l[i] - 1][j])) {
        f = false;
        break;
      }
    if (!f) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
