#include <bits/stdc++.h>
using namespace std;
int m, n;
const int N = 10e5 + 5;
vector<int> l(N), r(N), q(N), SS(N), SC(N), a(N);
bool work(int x) {
  fill(SS.begin(), SS.end(), 0);
  fill(SC.begin(), SC.end(), 0);
  for (int i = 0; i < m; i++) {
    if (q[i] >> (x - 1) & 1) {
      SS[l[i]]++;
      SS[r[i] + 1]--;
    }
  }
  for (int i = 1; i <= n; i++) {
    SS[i] += SS[i - 1];
    SC[i] = SC[i - 1] + (SS[i] == 0);
    a[i] |= (SS[i] != 0) << (x - 1);
  }
  for (int i = 0; i < m; i++) {
    if (!(q[i] >> (x - 1) & 1) && (SC[r[i]] - SC[l[i] - 1]) == 0) return false;
  }
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> l[i] >> r[i] >> q[i];
  for (int i = 1; i <= 30; i++) {
    if (!work(i)) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
