#include <bits/stdc++.h>
using namespace std;
long long dp[100005][35];
long long a[100005];
long long segtree[400005];
void build(long long node, long long start, long long end) {
  if (start == end) {
    segtree[node] = a[start];
    return;
  }
  long long mid = (start + end) / 2;
  build(2 * node + 1, start, mid);
  build(2 * node + 2, mid + 1, end);
  segtree[node] = segtree[2 * node + 1] & segtree[2 * node + 2];
}
long long query(long long node, long long start, long long end, long long l,
                long long r) {
  if (start > r || end < l) return -1;
  if (l <= start && end <= r) {
    return segtree[node];
  }
  long long mid = (start + end) / 2;
  long long p1 = query(2 * node + 1, start, mid, l, r);
  long long p2 = query(2 * node + 2, mid + 1, end, l, r);
  if (p1 == -1) return p2;
  if (p2 == -1) return p1;
  return p1 & p2;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  pair<pair<long long, long long>, long long> p[m];
  for (long long i = 0; i < m; i++) {
    cin >> p[i].first.first >> p[i].first.second >> p[i].second;
    p[i].first.first--;
    p[i].first.second--;
    long long temp = p[i].second;
    long long idx = 0;
    while (temp > 0) {
      if (temp % 2 == 1) {
        dp[p[i].first.first][idx] += 1;
        dp[p[i].first.second + 1][idx] -= 1;
      }
      temp = temp / 2;
      idx++;
    }
  }
  for (long long j = 0; j < 35; j++) {
    for (long long i = 1; i < n; i++) {
      dp[i][j] = dp[i][j] + dp[i - 1][j];
    }
  }
  long long pow[35];
  pow[0] = 1;
  for (long long i = 1; i < 35; i++) {
    pow[i] = 2 * pow[i - 1];
  }
  for (long long i = 0; i < n; i++) {
    long long temp = 0;
    for (long long j = 0; j < 35; j++) {
      if (dp[i][j] >= 1) {
        temp += pow[j];
      }
    }
    a[i] = temp;
  }
  build(0, 0, n - 1);
  for (long long i = 0; i < m; i++) {
    if (query(0, 0, n - 1, p[i].first.first, p[i].first.second) !=
        p[i].second) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (long long i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
long long choose(long long n, long long k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
bool isprime(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
void setprime(bool isprime[], long long n) {
  for (long long i = 0; i < n; i++) isprime[i] = true;
  isprime[0] = false;
  isprime[1] = false;
  for (long long i = 2; i < n; i++) {
    for (long long j = 2; i * j < n; j++) isprime[i * j] = false;
  }
}
