#include <bits/stdc++.h>
using namespace std;
int n, m;
const int len = 1e5 + 9;
int a[len];
int b[len];
int c[len];
int freq[len];
int res[len];
int pt[31];
int last = (1 << 17);
struct segmentTree {
  struct node {
    int value = 0;
    bool lazy = 0;
  };
  node tree[1 << 18];
  bool insert_(int l, int r, int now = 1, int st = 1, int ed = last) {
    if (st == ed) {
      tree[now].value = 1;
      return tree[now].value;
    }
    if (st >= l && ed <= r) {
      tree[now].lazy = 1;
      tree[now].value = 1;
      return tree[now].value;
    }
    int mid = (st + ed) / 2;
    if (tree[now].lazy != 0) {
      tree[now * 2].value = 1;
      tree[now * 2].lazy = 1;
      tree[now * 2 + 1].value = 1;
      tree[now * 2 + 1].lazy = 1;
      tree[now].lazy = 0;
    }
    if (l <= mid) {
      insert_(l, r, 2 * now, st, mid);
    }
    if (r > mid) {
      insert_(l, r, 2 * now + 1, mid + 1, ed);
    }
    tree[now].value = tree[now * 2].value && tree[now * 2 + 1].value;
    return tree[now].value;
  }
  int get_(int l, int r, int now = 1, int st = 1, int ed = last) {
    if (st == ed) {
      return tree[now].value;
    }
    if (st >= l && ed <= r) {
      return tree[now].value;
    }
    int mid = (st + ed) / 2;
    if (tree[now].lazy != 0) {
      tree[now * 2].value = 1;
      tree[now * 2].lazy = 1;
      tree[now * 2 + 1].value = 1;
      tree[now * 2 + 1].lazy = 1;
      tree[now].lazy = 0;
    }
    int res = 2147483647;
    if (l <= mid) {
      res = get_(l, r, 2 * now, st, mid) & res;
    }
    if (r > mid) {
      res = get_(l, r, 2 * now + 1, mid + 1, ed) & res;
    }
    return res;
  }
  void build() {
    for (int i = last; i < last * 2; i++) {
      tree[i].value = res[i - last + 1];
    }
    for (int i = last - 1; i > 0; i--) {
      tree[i].value = tree[i * 2].value & tree[i * 2 + 1].value;
    }
  }
};
segmentTree s;
int main() {
  scanf("%d%d", &n, &m);
  pt[0] = 1;
  for (int i = 1; i < 31; i++) {
    pt[i] = (pt[i - 1] << 1);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &a[i], &b[i], &c[i]);
  }
  for (int i = 0; i < 31; i++) {
    memset(freq, 0, sizeof freq);
    for (int j = 0; j < m; j++) {
      freq[a[j]] += (c[j] & pt[30 - i]) > 0;
      freq[b[j] + 1] -= (c[j] & pt[30 - i]) > 0;
    }
    int cou = 0;
    for (int j = 0; j < len; j++) {
      cou += freq[j];
      res[j] += min(cou, 1) * pt[30 - i];
    }
  }
  s.build();
  for (int i = 0; i < m; i++) {
    if (s.get_(a[i], b[i]) != c[i]) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    printf("%d ", s.get_(i, i));
  }
}
