#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000 + 7;
const double esp = 1e-13;
int n, m, xx[100000 + 10][50];
long long f[800000 + 10], a[100000 + 10], s, x[100000 + 10], y[100000 + 10],
    z[100000 + 10];
void build(int k, int l, int r) {
  if (l > r) return;
  if (l == r) {
    f[k] = a[l];
    return;
  }
  int m = (l + r) / 2;
  build(k * 2, l, m);
  build(k * 2 + 1, m + 1, r);
  f[k] = f[k * 2] & f[k * 2 + 1];
}
long long get(int k, int l, int r, int i, int j) {
  if (i > r || j < l) return s;
  if (i <= l && r <= j) return f[k];
  int m = (l + r) / 2;
  long long t1 = get(k * 2, l, m, i, j);
  long long t2 = get(k * 2 + 1, m + 1, r, i, j);
  return t1 & t2;
}
int bit(long long x, long long y) { return x >> (y - 1) & 1; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    cin >> x[i] >> y[i] >> z[i];
    for (long long j = 1; j <= 32; j++)
      if (bit(z[i], j) == 1) {
        xx[x[i]][j]++;
        xx[y[i] + 1][j]--;
      }
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= 33; j++) xx[i][j] += xx[i - 1][j];
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= 33; j++)
      if (xx[i][j]) a[i] += ((long long)1 << (j - 1));
  s = 1;
  for (long long i = 1; i <= 60; i++) s *= 2;
  s--;
  build(1, 1, n);
  for (long long i = 1; i <= m; i++) {
    if (get(1, 1, n, x[i], y[i]) != z[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (long long i = 1; i <= n; i++) cout << a[i] << " ";
}
