#include <bits/stdc++.h>
using namespace std;
int ans[1000005], tree[1000005], n, l[1000005], r[1000005], x[1000005];
int an[1000005][35];
int anded(int a, int b) {
  a += n, b += n;
  int s = (1 << 30) - 1;
  while (a <= b) {
    if (a % 2 == 1) s &= tree[a++];
    if (b % 2 == 0) s &= tree[b--];
    a /= 2, b /= 2;
  }
  return s;
}
void add(int k, int x1) {
  k += n;
  tree[k] += x1;
  for (k /= 2; k >= 1; k /= 2) tree[k] = tree[2 * k] & tree[2 * k + 1];
}
int main() {
  int m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < int(m); ++i) {
    cin >> l[i] >> r[i] >> x[i];
    int j = 0, val = x[i];
    while (val) {
      if (val % 2 == 1) an[l[i]][j]++, an[r[i] + 1][j]--;
      val /= 2, j++;
    }
  }
  for (int i = 0; i < int(30); ++i)
    for (int j = 0; j < int(n + 1); ++j) an[j + 1][i] += an[j][i];
  for (int i = 0; i < int(n); ++i) {
    int t = 1;
    for (int j = 0; j < int(30); ++j)
      ans[i + 1] += min(an[i + 1][j], 1) * t, t *= 2;
    add(i + 1, ans[i + 1]);
  }
  for (int i = 0; i < int(m); ++i)
    if (anded(l[i], r[i]) != x[i]) return cout << "NO", 0;
  cout << "YES" << endl;
  for (int i = 0; i < int(n); ++i) printf("%d ", ans[i + 1]);
  return 0;
}
