#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const int maxn = (long long int)1e9 + 7;
const double pi = acos(-1.0);
int v[31][100005];
int l[100005], r[100005], q[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    for (int j = 0; j <= 30; j++) {
      if (q[i] & (1 << j)) {
        v[j][l[i]]++;
        v[j][r[i] + 1]--;
      }
    }
  }
  for (int i = 0; i <= 30; i++)
    for (int j = 1; j <= n; j++) v[i][j] += v[i][j - 1];
  for (int i = 0; i <= 30; i++)
    for (int j = 1; j <= n; j++) {
      if (v[i][j])
        v[i][j] = 1;
      else
        v[i][j] = 0;
      v[i][j] += v[i][j - 1];
    }
  bool fg = true;
  for (int i = 1; i <= m; i++) {
    int x = 0;
    for (int j = 0; j <= 30; j++) {
      if (v[j][r[i]] - v[j][l[i] - 1] == (r[i] - l[i] + 1)) x += (1 << j);
    }
    if (x != q[i]) {
      fg = false;
      break;
    }
  }
  if (!fg) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    int x = 0;
    for (int j = 0; j <= 30; j++) {
      if (v[j][i] - v[j][i - 1]) x += (1 << j);
    }
    cout << x << " ";
  }
  return 0;
}
