#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, q, gl = 0;
int ans[200000], seg[3000000], hl[200000], hr[200000], hq[200000];
void func(int pos, int l, int r, int ql, int qr, int x) {
  if (r < ql || l > qr) return;
  if (l >= ql && r <= qr) {
    seg[pos] = seg[pos] | x;
    return;
  }
  int mid = (l + r) / 2;
  func(2 * pos, l, mid, ql, qr, x);
  func(2 * pos + 1, mid + 1, r, ql, qr, x);
  seg[pos] = seg[pos] | (seg[2 * pos] & seg[2 * pos + 1]);
}
int get(int pos, int l, int r, int ql, int qr) {
  if (r < ql || l > qr) {
    return (1 << 30) - 1;
  }
  if (l >= ql && r <= qr) {
    return seg[pos];
  }
  int mid = (l + r) / 2;
  int left = get(2 * pos, l, mid, ql, qr);
  int right = get(2 * pos + 1, mid + 1, r, ql, qr);
  return (left & right) | seg[pos];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  int m1 = m;
  for (int i = 0; i < m; i++) {
    cin >> l >> r >> q;
    l--, r--;
    hl[i] = l, hr[i] = r, hq[i] = q;
    func(1, 0, n - 1, l, r, q);
  }
  for (int i = 0; i < m; i++) {
    if (hq[i] != get(1, 0, n - 1, hl[i], hr[i])) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << get(1, 0, n - 1, i, i) << " ";
  }
  return 0;
}
