#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int mn = 1e5 + 1;
int n, m, tree[mn * 4][30];
struct query {
  int l, r, k;
} queries[mn];
void update(int id, int l, int r, int x, int y, int type) {
  if (l > y || r < x) {
    return;
  }
  if (l >= x && r <= y) {
    tree[id][type] = r - l + 1;
    return;
  }
  int mid = (l + r) / 2;
  if (tree[id][type] == r - l + 1) {
    tree[id * 2][type] = mid - l + 1;
    tree[id * 2 + 1][type] = r - mid;
  }
  update(id * 2, l, mid, x, y, type);
  update(id * 2 + 1, mid + 1, r, x, y, type);
  tree[id][type] = tree[id * 2][type] + tree[id * 2 + 1][type];
}
int get(int id, int l, int r, int x, int y, int type) {
  if (l > y || r < x) {
    return 0;
  }
  if (l >= x && r <= y) {
    return tree[id][type];
  }
  int mid = (l + r) / 2;
  if (tree[id][type] == r - l + 1) {
    tree[id * 2][type] = mid - l + 1;
    tree[id * 2 + 1][type] = r - mid;
  }
  return get(id * 2, l, mid, x, y, type) +
         get(id * 2 + 1, mid + 1, r, x, y, type);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> queries[i].l >> queries[i].r >> queries[i].k;
    for (int j = 0; j < 30; ++j) {
      if ((queries[i].k >> j) & 1)
        update(1, 1, n, queries[i].l, queries[i].r, j);
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < 30; j++) {
      if (!((queries[i].k >> j) & 1)) {
        if (get(1, 1, n, queries[i].l, queries[i].r, j) ==
            queries[i].r - queries[i].l + 1) {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    int ans = 0;
    for (int j = 0; j < 30; j++) {
      ans += get(1, 1, n, i, i, j) * (1 << j);
    }
    cout << ans << " ";
  }
}
