#include <bits/stdc++.h>
using namespace std;
int N = 262144;
int n, m;
vector<int> p(N, 0);
void add(int pos, int a, int b, int l, int r, int v) {
  if (a >= r || b <= l) {
    return;
  } else if (a >= l && b <= r) {
    p[pos] |= v;
  } else {
    add(pos * 2, a, (a + b) / 2, l, r, v);
    add(pos * 2 + 1, (a + b) / 2, b, l, r, v);
  }
}
int query(int pos, int a, int b, int l, int r) {
  if (a >= r || b <= l) {
    return (1 << 30) - 1;
  } else if (a >= l && b <= r) {
    return p[pos];
  } else {
    return query(pos * 2, a, (a + b) / 2, l, r) &
           query(pos * 2 + 1, (a + b) / 2, b, l, r);
  }
}
int get(int x) {
  x += N / 2;
  int r = p[x];
  while (x >= 1) {
    r |= p[x];
    x /= 2;
  }
  return r;
}
int main() {
  cin >> n >> m;
  int l[100000], r[100000], q[100000];
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    l[i]--;
    add(1, 0, N / 2, l[i], r[i], q[i]);
  }
  for (int i = 0; i < m; i++) {
    if (query(1, 0, N / 2, l[i], r[i]) != q[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    cout << get(i) << " ";
  }
  cout << endl;
  return 0;
}
