#include <bits/stdc++.h>
using namespace std;
const int N = 200100, M = 33;
int n, m, size;
struct Sgmtree {
  int son[2], bit[M];
};
Sgmtree sgm[N];
int ans[N], cover[N][M], l[N], r[N], q[N];
void maintain(int node) {
  int sl = sgm[node].son[0], sr = sgm[node].son[1];
  for (int i = 0; i <= 31; i++)
    sgm[node].bit[i] = sgm[sl].bit[i] + sgm[sr].bit[i];
}
void build(int& node, int l, int r) {
  node = ++size;
  if (l == r) {
    int v = ans[l], pos = 0;
    while (v) {
      if (v & 1) sgm[node].bit[pos] = 1;
      v >>= 1;
      pos++;
    }
    return;
  }
  int mid = (l + r) >> 1;
  build(sgm[node].son[0], l, mid);
  build(sgm[node].son[1], mid + 1, r);
  maintain(node);
}
int asktot(int node, int l, int r, int a, int b, int c) {
  if ((a <= l) && (b >= r)) return sgm[node].bit[c];
  int mid = (l + r) >> 1;
  int t1 = 0, t2 = 0;
  if (a <= mid) t1 = asktot(sgm[node].son[0], l, mid, a, b, c);
  if (b > mid) t2 = asktot(sgm[node].son[1], mid + 1, r, a, b, c);
  return t1 + t2;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &l[i], &r[i], &q[i]);
    int pos = 0, v = q[i];
    while (v) {
      if (v & 1) {
        cover[l[i]][pos] += 1;
        cover[r[i] + 1][pos] -= 1;
      }
      pos++;
      v >>= 1;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 31; j >= 0; j--) {
      cover[i][j] += cover[i - 1][j];
      ans[i] = (ans[i] << 1) + (cover[i][j] > 0);
    }
  int node;
  build(node, 1, n);
  for (int i = 1; i <= m; i++)
    for (int j = 0; j <= 31; j++) {
      if ((!(q[i] & 1)) &&
          (asktot(1, 1, n, l[i], r[i], j) == (r[i] - l[i] + 1))) {
        printf("NO\n");
        return 0;
      }
      q[i] >>= 1;
    }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
