#include <bits/stdc++.h>
using namespace std;
int tree[100003 << 2], lazy[100003 << 2];
void propagate(int node, int l, int r) {
  if (lazy[node] > 0) {
    int L = (node << 1);
    int R = L | 1;
    tree[node] |= lazy[node];
    if (l != r) {
      lazy[L] |= lazy[node];
      lazy[R] |= lazy[node];
    }
    lazy[node] = 0;
  }
}
int query(int node, int l, int r, int bl, int br) {
  if (l > r || l > br || r < bl) {
    return -1;
  } else {
    propagate(node, l, r);
    if (l >= bl && r <= br) {
      return tree[node];
    } else {
      int mid = (l + r) >> 1;
      int L = (node << 1);
      int R = L | 1;
      int q1 = query(L, l, mid, bl, br);
      int q2 = query(R, mid + 1, r, bl, br);
      if (q1 == -1) return q2;
      if (q2 == -1) return q1;
      return q1 & q2;
    }
  }
}
void update(int node, int l, int r, int bl, int br, long long v) {
  propagate(node, l, r);
  if (l > r || l > br || r < bl) {
    return;
  } else {
    if (l >= bl && r <= br) {
      lazy[node] = v;
      propagate(node, l, r);
      return;
    } else {
      int mid = (l + r) >> 1;
      int L = (node << 1);
      int R = L | 1;
      update(L, l, mid, bl, br, v);
      update(R, mid + 1, r, bl, br, v);
      tree[node] = tree[L] & tree[R];
    }
  }
}
int n, m, L[100003], R[100003], Q[100003];
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &L[i], &R[i], &Q[i]);
    L[i]--;
    R[i]--;
    update(1, 0, n - 1, L[i], R[i], Q[i]);
  }
  for (int i = 0; i < m; i++) {
    if (query(1, 0, n - 1, L[i], R[i]) != Q[i]) {
      printf("NO\n");
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << query(1, 0, n - 1, i, i) << " ";
  }
  return 0;
}
