#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dx[8] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
const long long inf = 998244353;
vector<int> adj[200010], vis(200010, 0), par(200010, 0), dis(200010, 0),
    di(200010, 0), fin(200010, 0);
int myrandom(int i) { return std::rand() % i; }
const int MAX = 100010;
int a[MAX], l[MAX], r[MAX], q[MAX], t[4 * MAX];
using namespace std;
inline void build(int v, int l, int r) {
  if (l == r) {
    t[v] = a[l];
    return;
  }
  int mid = (l + r) / 2;
  build(2 * v, l, mid);
  build(2 * v + 1, mid + 1, r);
  t[v] = t[2 * v] & t[2 * v + 1];
}
inline int query(int v, int l, int r, int tl, int tr) {
  if (l > r) {
    return (1 << 30) - 1;
  }
  if (tl == l && tr == r) {
    return t[v];
  }
  int mid = (l + r) / 2;
  if (tr <= mid) {
    return query(2 * v, l, mid, tl, tr);
  } else if (tl > mid) {
    return query(2 * v + 1, mid + 1, r, tl, tr);
  } else {
    return query(2 * v, l, mid, tl, mid) &
           query(2 * v + 1, mid + 1, r, mid + 1, tr);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    l[i]--;
  }
  for (int i = 0; i <= 30; i++) {
    int sum[n + 2];
    memset(sum, 0, sizeof(sum));
    for (int j = 0; j < m; j++) {
      if ((1 << i) & q[j]) {
        sum[l[j]]++;
        sum[r[j]]--;
      }
    }
    for (int j = 0; j < n; j++) {
      if (j > 0) {
        sum[j] += sum[j - 1];
      }
      if (sum[j] > 0) {
        a[j] |= 1 << i;
      }
    }
  }
  build(1, 0, n - 1);
  for (int i = 0; i < m; i++) {
    if (query(1, 0, n - 1, l[i], r[i] - 1) != q[i]) {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << '\n';
}
