#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, q;
map<pair<int, int>, int> vi;
int V[100005 << 2], ly[100005 << 2];
void push_down(int o) {
  if (ly[o]) {
    ly[o << 1] |= ly[o];
    ly[o << 1 | 1] |= ly[o];
    V[o << 1] |= ly[o];
    V[o << 1 | 1] |= ly[o];
    ly[o] = 0;
  }
}
void push_up(int o) { V[o] = V[o << 1] & V[o << 1 | 1]; }
void ud(int o, int l, int r, int L, int R, int x) {
  int mid = (l + r) / 2;
  if (L <= l && r <= R) {
    V[o] |= x;
    ly[o] |= x;
    return;
  }
  push_down(o);
  if (L <= mid) ud(o << 1, l, mid, L, R, x);
  if (R > mid) ud(o << 1 | 1, mid + 1, r, L, R, x);
  push_up(o);
}
int qy(int o, int l, int r, int L, int R) {
  int mid = (l + r) / 2;
  if (L <= l && r <= R) return V[o];
  push_down(o);
  int ans = (1 << 30) - 1;
  if (L <= mid) ans &= qy(o << 1, l, mid, L, R);
  if (R > mid) ans &= qy(o << 1 | 1, mid + 1, r, L, R);
  push_up(o);
  return ans;
}
int main() {
  cin >> n >> m;
  int ok = 1;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &l, &r, &q);
    int tp = qy(1, 1, n, l, r);
    if (vi[make_pair(l, r)]) {
      if (tp != q) {
        ok = 0;
      }
    }
    if (!ok) continue;
    vi[make_pair(l, r)] = 1;
    if ((tp & q) == tp)
      ud(1, 1, n, l, r, q);
    else
      ok = 0;
  }
  if (!ok) {
    puts("NO");
    return 0;
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", qy(1, 1, n, i, i));
}
