#include <bits/stdc++.h>
using namespace std;
struct Query {
  int a, b, v;
};
int t[100001 * 4] = {}, lazy[100001 * 4] = {}, N, M, B[100001] = {};
Query qs[100001] = {};
void push(int n, int l, int r) {
  if (lazy[n]) {
    t[n] |= lazy[n];
    if (l != r) {
      lazy[2 * n] |= lazy[n];
      lazy[2 * n + 1] |= lazy[n];
    }
    lazy[n] = 0;
  }
}
void update(int n, int l, int r, int a, int b, int v) {
  if (r < a || l > b)
    return;
  else if (a <= l && r <= b)
    lazy[n] |= v;
  else {
    push(n, l, r);
    int mid = (l + r) / 2;
    update(2 * n, l, mid, a, b, v);
    push(2 * n, l, mid);
    update(2 * n + 1, mid + 1, r, a, b, v);
    push(2 * n + 1, mid + 1, r);
    t[n] = t[2 * n + 1] & t[2 * n];
  }
}
int query(int n, int l, int r, int a, int b) {
  push(n, l, r);
  if (r < a || l > b)
    return -1;
  else if (a <= l && r <= b)
    return t[n];
  else {
    int mid = (l + r) / 2;
    return query(2 * n, l, mid, a, b) & query(2 * n + 1, mid + 1, r, a, b);
  }
}
void getans(int n, int l, int r) {
  push(n, l, r);
  if (r == l) {
    B[l] = t[n];
  } else {
    int mid = (l + r) / 2;
    getans(2 * n, l, mid);
    getans(2 * n + 1, mid + 1, r);
  }
}
int main() {
  scanf("%d %d\n", &N, &M);
  for (int x = 0; x < M; x++)
    cin >> qs[x].a >> qs[x].b >> qs[x].v, qs[x].a--, qs[x].b--,
        update(1, 0, N - 1, qs[x].a, qs[x].b, qs[x].v);
  bool can = true;
  for (int x = 0; x < M; x++)
    can &= query(1, 0, N - 1, qs[x].a, qs[x].b) == qs[x].v;
  printf(can ? "YES\n" : "NO\n");
  if (can) {
    getans(1, 0, N - 1);
    for (int x = 0; x < N; x++)
      printf("%d", B[x]), printf(x + 1 == N ? "\n" : " ");
  }
}
