#include <bits/stdc++.h>
using namespace std;
const int N = 100010, M = 35;
long long prefix[M][N], bit[M][N];
int get_sum(int p, int left, int right) {
  int res = prefix[p][right];
  if (left > 0) res -= prefix[p][left - 1];
  return res;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<vector<int>> arr;
  arr.reserve(m);
  for (int i = 0; i < m; i++) {
    int left, right, q;
    scanf("%d %d %d", &left, &right, &q);
    for (long long j = 0; (1LL << j) <= q; j++) {
      if (q & (1 << j)) {
        bit[j][left - 1] += 1;
        bit[j][right] += -1;
      }
    }
    arr.push_back({left, right, q});
  }
  for (int j = 0; j < M; j++) {
    int balance = 0;
    for (int i = 0; i < n; i++) {
      balance += bit[j][i];
      prefix[j][i] = (balance > 0);
      if (i > 0) prefix[j][i] += prefix[j][i - 1];
    }
  }
  for (auto it : arr) {
    for (int j = 0; j < M; j++) {
      if (((1LL << j) & it[2]) == 0 &&
          get_sum(j, it[0] - 1, it[1] - 1) == it[1] - it[0] + 1) {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; i++) {
    long long elem = 0;
    for (int j = 0; j < M; j++) {
      if (get_sum(j, i, i)) elem |= (1LL << j);
    }
    printf("%lld ", elem);
  }
  return 0;
}
