#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10, allone = ((long long)1 << 31) - 1;
long long segment[3 * N], segmentand[3 * N], n, q, l[N], r[N], k[N], a[N];
void addSEG(int L, int R, int num, int s, int f, int id) {
  if (R <= s || L >= f || s == f) return;
  if (L <= s && R >= f) {
    segment[id] = (segment[id] | num);
    return;
  }
  long long mid = (s + f) / 2;
  addSEG(L, R, num, s, mid, id * 2);
  addSEG(L, R, num, mid, f, id * 2 + 1);
}
void findval(int L, int R, int num, int s, int f, int id) {
  if (R <= s || L >= f || s == f) return;
  num = (num | segment[id]);
  if (s == f - 1) {
    segmentand[id] = num;
    a[L] = num;
    return;
  }
  long long mid = (s + f) / 2;
  findval(L, R, num, s, mid, id * 2);
  findval(L, R, num, mid, f, id * 2 + 1);
  segmentand[id] = (segmentand[id * 2] & segmentand[id * 2 + 1]);
}
long long findand(int L, int R, int s, int f, int id) {
  if (L >= f || R <= s || s == f) return allone;
  if (L <= s && R >= f) return segmentand[id];
  int mid = (s + f) / 2;
  return (findand(L, R, s, mid, id * 2) & findand(L, R, mid, f, id * 2 + 1));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 0; i < q; i++) {
    cin >> l[i] >> r[i] >> k[i];
    addSEG(l[i] - 1, r[i], k[i], 0, n, 1);
  }
  for (int i = 0; i < n; i++) findval(i, i + 1, 0, 0, n, 1);
  for (int i = 0; i < q; i++)
    if (findand(l[i] - 1, r[i], 0, n, 1) != k[i]) return (cout << "NO"), 0;
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
