#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
using namespace std;
long long dp[100005][35];
long long val[100005][35];
long long a[100005][35];
struct node {
  long long l, r, q;
};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long i, j;
  node b[m + 5];
  for (i = 1; i <= m; i++) cin >> b[i].l >> b[i].r >> b[i].q;
  for (i = 1; i <= m; i++) {
    vector<long long> v;
    v.clear();
    while (b[i].q) {
      v.push_back(b[i].q % 2);
      b[i].q /= 2;
    }
    for (j = 0; j < v.size(); j++) a[i][j] = v[j];
  }
  for (i = 1; i <= m; i++) {
    for (j = 0; j <= 31; j++)
      if (a[i][j]) {
        val[b[i].l][j] += 1;
        val[b[i].r + 1][j] -= 1;
      }
  }
  for (i = 1; i <= n; i++)
    for (j = 0; j <= 31; j++) {
      val[i][j] += val[i - 1][j];
    }
  for (i = 1; i <= n; i++)
    for (j = 0; j <= 31; j++)
      if (val[i][j]) val[i][j] = 1;
  for (i = 1; i <= n; i++)
    for (j = 0; j <= 31; j++) {
      dp[i][j] = dp[i - 1][j];
      if (val[i][j]) dp[i][j] += 1;
    }
  long long f = 1;
  for (i = 1; i <= m; i++) {
    for (j = 0; j <= 31; j++) {
      long long x = dp[b[i].r][j] - dp[b[i].l - 1][j];
      if ((x == (b[i].r - b[i].l + 1) && a[i][j] == 0) ||
          (x != (b[i].r - b[i].l + 1) && a[i][j] == 1)) {
        break;
      }
    }
    if (j <= 31) break;
  }
  if (i <= m)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (i = 1; i <= n; i++) {
      long long sum = 0;
      for (j = 0; j <= 31; j++)
        if (val[i][j]) sum = sum + (1 << j);
      cout << sum << " ";
    }
  }
  return 0;
}
