#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long powx(long long a, long long p) {
  long long ans = 1;
  for (int i = 0; i < p; i++) ans *= a;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> cons;
  long long fre[n + 2][32], dp[n + 2][32];
  for (long long i = 0; i <= n + 1; i++) {
    for (long long j = 0; j < 32; j++) fre[i][j] = 0, dp[i][j] = 0;
  }
  for (long long i = 0; i < m; i++) {
    long long l, r, q;
    cin >> l >> r >> q;
    cons.push_back({l, r, q});
    for (long long j = 0; j < 32; j++) {
      if (q & (1 << j)) {
        fre[l][j] += 1;
        fre[r + 1][j] += -1;
      }
    }
  }
  for (long long j = 0; j < 32; j++) {
    for (long long i = 1; i <= n; i++) {
      fre[i][j] += fre[i - 1][j];
      dp[i][j] = min((long long)1, fre[i][j]);
    }
  }
  for (long long j = 0; j < 32; j++) {
    for (long long i = 1; i <= n; i++) {
      dp[i][j] += dp[i - 1][j];
    }
  }
  for (long long i = 0; i < m; i++) {
    long long l = cons[i][0];
    long long r = cons[i][1];
    long long q = cons[i][2];
    for (long long j = 0; j < 3; j++) {
      long long cnt = dp[r][j] - dp[l - 1][j];
      if ((q & (1 << j)) == 0) {
        if (cnt == r - l + 1) {
          cout << "NO" << '\n';
          return 0;
        }
      }
    }
  }
  cout << "YES" << '\n';
  for (long long i = 1; i <= n; i++) {
    long long x = 0;
    for (long long j = 0; j < 32; j++) {
      if (fre[i][j] > 0) x += (1 << j);
    }
    cout << x << " ";
  }
  return 0;
}
