#include <bits/stdc++.h>
using namespace std;
const int base = 1331;
const int N = 1e5 + 1;
template <typename T>
inline void Cin(T& x) {
  char c = getchar();
  x = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
}
template <typename T, typename... Args>
inline void Cin(T& a, Args&... args) {
  Cin(a);
  Cin(args...);
}
int s[N][31], n, m, f[N][31], a[N], sum[N][31], l[N], r[N], q[N], res,
    ST[4 * N];
void build(int id, int l, int r) {
  if (l == r) {
    ST[id] = a[l];
    return;
  }
  int mid = (l + r) / 2;
  build(id * 2, l, mid);
  build(id * 2 + 1, mid + 1, r);
  ST[id] = ST[id * 2] & ST[id * 2 + 1];
}
void Get(int id, int l, int r, int u, int v) {
  if (l > v || r < u) return;
  if (l >= u && r <= v) {
    res = res & ST[id];
    return;
  }
  int mid = (l + r) / 2;
  Get(id * 2, l, mid, u, v);
  Get(id * 2 + 1, mid + 1, r, u, v);
}
void read(void) {}
signed main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    for (int j = 0; j <= 30; j++) {
      if (q[i] >> j & 1 == 1) {
        s[l[i]][j]++;
        s[r[i] + 1][j]--;
      }
    }
  }
  for (int j = 0; j <= 30; j++) {
    for (int i = 1; i <= n; i++) {
      sum[i][j] = sum[i - 1][j] + s[i][j];
      if (sum[i][j] > 0)
        f[i][j] = 1;
      else
        f[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 30; j++) {
      if (f[i][j] == 1) a[i] += (1 << j);
    }
  }
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    res = a[l[i]];
    Get(1, 1, n, l[i], r[i]);
    if (res != q[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
}
