#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m;
int a[N];
int l[N], r[N], q[N];
int sum[N];
int T[4 * N];
void build(int p, int l, int r) {
  if (l == r) {
    T[p] = a[l];
    return;
  }
  int m = (l + r) >> 1;
  build(p << 1, l, m);
  build(p << 1 | 1, m + 1, r);
  T[p] = T[p << 1] & T[p << 1 | 1];
}
int get(int p, int l, int r, int u, int v) {
  if (v < l || r < u) return INT_MAX;
  if (u <= l && r <= v) return T[p];
  int m = (l + r) >> 1;
  int t1 = get(p << 1, l, m, u, v);
  int t2 = get(p << 1 | 1, m + 1, r, u, v);
  return (t1 & t2);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d %d", &l[i], &r[i], &q[i]);
  }
  for (int bit = 0; bit <= 30; ++bit) {
    for (int i = 0; i <= n; ++i) sum[i] = 0;
    for (int i = 0; i < m; ++i) {
      if (q[i] & (1 << bit)) {
        sum[l[i]]++;
        sum[r[i] + 1]--;
      }
    }
    for (int i = 1; i <= n; ++i) sum[i] += sum[i - 1];
    for (int i = 1; i <= n; ++i)
      if (sum[i]) a[i] |= (1 << bit);
  }
  build(1, 1, n);
  for (int i = 0; i < m; ++i) {
    int value = get(1, 1, n, l[i], r[i]);
    if (value != q[i]) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  return 0;
}
