#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int B = 317;
const int N = 1e5 + 7;
const long long mod = 998244353;
const long long inf = 1e18;
long long n, k;
long long a[N];
long long l[N];
long long q[N];
long long r[N];
long long sum[N];
long long t[4 * N];
void build(int x, int l, int r) {
  if (l == r) {
    t[x] = a[l];
    return;
  }
  int m = (l + r) / 2;
  build(x * 2, l, m);
  build(x * 2 + 1, m + 1, r);
  t[x] = t[x * 2] & t[x * 2 + 1];
}
long long get(int x, int l, int r, int tl, int tr) {
  if (tl > tr) return (1LL << 30) - 1;
  if (l == tl && tr == r) return t[x];
  int m = (l + r) / 2;
  return (get(x * 2, l, m, tl, min(tr, m)) &
          get(x * 2 + 1, m + 1, r, max(m + 1, tl), tr));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= k; i++) {
    cin >> l[i] >> r[i] >> q[i];
  }
  for (long long i = 0; i < 31; i++) {
    for (int j = 1; j <= n; j++) sum[j] = 0;
    for (int j = 1; j <= k; j++) {
      if ((q[j] >> i) & 1) {
        sum[l[j]]++;
        sum[r[j] + 1]--;
      }
    }
    for (int j = 1; j <= n; j++) {
      sum[j] += sum[j - 1];
      if (sum[j] > 0) a[j] |= (1LL << i);
    }
  }
  build(1, 1, n);
  for (int i = 1; i <= k; i++) {
    if (get(1, 1, n, l[i], r[i]) != q[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
}
