#include <bits/stdc++.h>
using namespace std;
int const MAX = 110000;
struct Node {
  int l, r;
  int val;
};
Node tree[10 * MAX];
Node a[MAX];
vector<int> ans;
void build(int step, int l, int r) {
  tree[step].l = l;
  tree[step].r = r;
  tree[step].val = 0;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(step << 1, l, mid);
  build(((step << 1) + 1), mid + 1, r);
}
void update(int step, int l, int r, int val) {
  if (tree[step].l == l && tree[step].r == r) {
    tree[step].val |= val;
    return;
  }
  int mid = (tree[step].l + tree[step].r) >> 1;
  if (r <= mid)
    update(step << 1, l, r, val);
  else if (l > mid)
    update((step << 1) + 1, l, r, val);
  else {
    update(step << 1, l, mid, val);
    update((step << 1) + 1, mid + 1, r, val);
  }
}
int query(int step, int l, int r) {
  if (tree[step].l == l && tree[step].r == r) return tree[step].val;
  int mid = (tree[step].l + tree[step].r) >> 1;
  if (r <= mid) return query(step << 1, l, r);
  if (l > mid)
    return query((step << 1) + 1, l, r);
  else
    return query(step << 1, l, mid) & query((step << 1) + 1, mid + 1, r);
}
void solve(int step) {
  if (step != 1) tree[step].val |= tree[step >> 1].val;
  if (tree[step].l == tree[step].r) {
    ans.push_back(tree[step].val);
    return;
  }
  solve(step << 1);
  solve((step << 1) + 1);
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  build(1, 1, n);
  for (int i = 0; i < m; i++) {
    scanf("%d %d %d", &a[i].l, &a[i].r, &a[i].val);
    update(1, a[i].l, a[i].r, a[i].val);
  }
  bool flag = true;
  for (int i = 0; i < m; i++) {
    if (query(1, a[i].l, a[i].r) != a[i].val) {
      flag = false;
      break;
    }
  }
  solve(1);
  if (flag) {
    printf("YES\n");
    for (int i = 0; i < ans.size(); i++)
      printf("%d%c", ans[i], i == n ? '\n' : ' ');
    ans.clear();
    printf("\n");
  } else
    printf("NO\n");
}
