#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long double PI = acos(-1);
const long long MOD = 1000000007;
const long long FMOD = 998244353;
const long double eps = 1e-9;
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());
long long p[200010], ans[200010], zero[200010];
signed main() {
  long long n, m;
  cin >> n >> m;
  long long l[m + 1], r[m + 1], q[m + 1];
  for (long long i = 1; i < m + 1; i++) {
    cin >> l[i] >> r[i] >> q[i];
  }
  for (long long i = 0; i <= 30; i++) {
    for (long long j = 1; j <= n; j++) {
      p[j] = 0;
      zero[j] = 0;
    }
    for (long long j = 1; j <= m; j++) {
      if ((q[j] & (1LL << i))) {
        p[l[j]]++;
        p[r[j] + 1]--;
      }
    }
    for (long long j = 1; j <= n; j++) {
      p[j] += p[j - 1];
      zero[j] = zero[j - 1] + (p[j] == 0);
      ans[j] |= ((p[j] != 0) * (1LL << i));
    }
    for (long long j = 1; j <= m; j++) {
      if (!(q[j] & (1LL << i))) {
        if (zero[r[j]] - zero[l[j] - 1] == 0) {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  cout << "YES" << endl;
  for (long long i = 1; i <= n; i++) cout << ans[i] << " ";
}
