#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<int> ans(n, 0);
  vector<pair<pair<int, int>, int> > queries(m);
  for (auto &x : queries) {
    scanf("%d %d %d", &x.first.first, &x.first.second, &x.second);
    x.first.first--;
  }
  for (int b = 1; b < (1 << 30); b <<= 1) {
    vector<int> pos(n + 1, 0);
    for (auto &x : queries)
      if (x.second & b) {
        pos[x.first.first]++;
        pos[x.first.second]--;
      }
    int psum = 0;
    for (int i = 0; i < n; ++i) {
      psum += pos[i];
      if (psum) ans[i] |= b;
    }
  }
  vector<int> ands(n * 18);
  copy(ans.begin(), ans.end(), ands.begin());
  for (int step = 1; step < 18; ++step)
    for (int i = 0; i < n; ++i) {
      ands[step * n + i] =
          ands[(step - 1) * n + i] &
          ands[(step - 1) * n + min(i + (1 << (step - 1)), n - 1)];
    }
  bool valid = true;
  for (auto &x : queries) {
    if (!valid) break;
    int p = 31 - __builtin_clz(x.first.second - x.first.first);
    int temp =
        ands[p * n + x.first.first] & ands[p * n + (x.first.second - (1 << p))];
    valid = temp == x.second;
  }
  if (!valid)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int x : ans) printf("%d ", x);
    printf("\n");
  }
  return 0;
}
