#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 11;
int num[N];
struct Segment {
  int mark[N << 2];
  int x1, y1, ans;
  int n;
  void init(int x) {
    n = x;
    build(1, 1, n);
  }
  void build(int u, int l, int r) {
    mark[u] = 0;
    if (l == r) return;
    build(u << 1, l, ((l + r) >> 1));
    build(u << 1 | 1, ((l + r) >> 1) + 1, r);
  }
  void update(int l, int r, int d) {
    x1 = l, y1 = r;
    _update(1, 1, n, d);
  }
  void up(int u) { mark[u] |= (mark[u << 1] & mark[u << 1 | 1]); }
  void _update(int u, int l, int r, int d) {
    if (x1 <= l && r <= y1) {
      mark[u] |= d;
      return;
    }
    if (x1 <= ((l + r) >> 1)) _update(u << 1, l, ((l + r) >> 1), d);
    if (y1 > ((l + r) >> 1)) _update(u << 1 | 1, ((l + r) >> 1) + 1, r, d);
    up(u);
  }
  int query(int l, int r) {
    x1 = l, y1 = r;
    ans = (1 << 30) - 1;
    _query(1, 1, n);
    return ans;
  }
  void _query(int u, int l, int r) {
    if (x1 <= l && r <= y1) {
      ans &= mark[u];
      return;
    }
    if (x1 <= ((l + r) >> 1)) _query(u << 1, l, ((l + r) >> 1));
    if (y1 > ((l + r) >> 1)) _query(u << 1 | 1, ((l + r) >> 1) + 1, r);
  }
  void fun() { _fun(1, 1, n); }
  void _fun(int u, int l, int r) {
    if (u > 1) mark[u] |= mark[u >> 1];
    if (l == r) {
      num[l] = mark[u];
      return;
    }
    _fun(u << 1, l, ((l + r) >> 1));
    _fun(u << 1 | 1, ((l + r) >> 1) + 1, r);
  }
};
Segment seg;
int n, m;
int oper[N][3];
int main() {
  while (scanf("%d %d", &n, &m) == 2) {
    for (int i = 0; i < m; ++i)
      for (int j = 0; j < 3; ++j) scanf("%d", &oper[i][j]);
    seg.init(n);
    for (int i = 0; i < m; ++i) {
      seg.update(oper[i][0], oper[i][1], oper[i][2]);
    }
    bool mark = false;
    for (int i = 0; i < m; ++i) {
      if (seg.query(oper[i][0], oper[i][1]) != oper[i][2]) {
        mark = true;
        break;
      }
    }
    if (mark)
      printf("NO\n");
    else {
      seg.fun();
      printf("YES\n");
      for (int i = 1; i <= n; ++i) {
        printf("%d", num[i]);
        if (i != n)
          printf(" ");
        else
          printf("\n");
      }
    }
  }
}
