#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long maxn = 3e5;
const long long mod = 1e9 + 7;
const long double PI = acos((long double)-1);
long long pw(long long a, long long b, long long md = mod) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = (a * res) % md;
    }
    a = (a * a) % md;
    b >>= 1;
  }
  return (res);
}
long long n, m;
long long l[maxn], r[maxn], q[maxn];
long long fen[maxn][32];
long long b[maxn][32];
void udp(long long pos, long long x, long long ind) {
  for (; pos < maxn; pos += pos & (-pos)) fen[pos][ind] += x;
}
long long sum(long long pos, long long x) {
  long long ans = 0;
  for (; pos; pos -= pos & (-pos)) ans += fen[pos][x];
  return ((ans) ? (1 << x) : 0);
}
void add(long long x) {
  cin >> l[x] >> r[x] >> q[x];
  for (long long i = 0; i <= 30; i++)
    if (q[x] & (1 << i)) udp(l[x], 1, i), udp(r[x] + 1, -1, i);
}
long long get(long long l, long long r) {
  long long ans = b[l][0];
  for (long long i = 17; i >= 0; i--)
    if (l + (1LL << i) - 1 <= r) ans &= b[l][i], l += (1LL << i);
  return (ans);
}
bool chk(long long x) { return (get(l[x], r[x]) == q[x]); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < m; i++) add(i);
  for (long long i = 1; i <= n; i++)
    for (long long j = 0; j <= 30; j++) b[i][0] |= sum(i, j);
  for (long long i = 1; i <= 17; i++)
    for (long long j = 1; j <= n; j++)
      if (j + (1LL << i) - 1 <= n)
        b[j][i] = b[j][i - 1] & b[j + (1LL << (i - 1))][i - 1];
  for (long long i = 0; i < m; i++)
    if (!chk(i)) return (cout << "NO", 0);
  ;
  cout << "YES" << '\n';
  for (long long i = 1; i <= n; i++) cout << b[i][0] << ' ';
  return (0);
}
