#include <bits/stdc++.h>
using namespace std;
int tree[4 * 100010], arr[4 * 100010], n;
void build(int no, int L, int R) {
  if (L == R) {
    tree[no] = arr[L];
    return;
  }
  int nl = 2 * no, nr = 2 * no + 1, mid = (L + R) >> 1;
  build(nl, L, mid);
  build(nr, mid + 1, R);
  tree[no] = tree[nl] & tree[nr];
}
void build() { build(1, 0, n - 1); }
int query(int no, int L, int R, int i, int j) {
  int nl = 2 * no, nr = 2 * no + 1, mid = (L + R) >> 1;
  if (i > R || j < L) return (~0);
  if (i <= L && R <= j) return tree[no];
  int a = query(nl, L, mid, i, j);
  int b = query(nr, mid + 1, R, i, j);
  return a & b;
}
int query(int i, int j) { return query(1, 0, n - 1, i, j); }
pair<pair<int, int>, int> command[100010];
int act[32];
struct s {
  int at;
  int num;
  int ent;
  s() {}
  s(int at, int num, int ent) : at(at), num(num), ent(ent) {}
  bool operator<(const s &rhs) const {
    if (at != rhs.at) return at < rhs.at;
    return ent > rhs.ent;
  }
} in[200020];
int main() {
  int m;
  scanf("%d %d", &n, &m);
  int k = 0;
  for (int i = (0), __ = (m); i < __; ++i) {
    int l, r, q;
    scanf("%d %d %d", &l, &r, &q);
    l--;
    r--;
    in[k++] = s(l, q, 0);
    in[k++] = s(r + 1, q, 1);
    command[i] = make_pair(make_pair(l, r), q);
  }
  memset(act, 0, sizeof act);
  sort(in, in + k);
  for (int i = (0), __ = (k); i < __; ++i) {
    s nxt = in[i];
    for (int j = (31), __ = (0); j >= __; --j)
      if (nxt.num & (1 << j)) act[j] = (nxt.ent ? act[j] - 1 : act[j] + 1);
    int b = nxt.at;
    int e = (i + 1 == k) ? n : in[i + 1].at;
    for (int j = (b), __ = (e); j < __; ++j) {
      for (int w = (31), __ = (0); w >= __; --w)
        if (act[w]) arr[j] |= (1 << w);
    }
  }
  build();
  for (int i = (0), __ = (m); i < __; ++i) {
    int l = command[i].first.first, r = command[i].first.second;
    int q = command[i].second;
    if (query(l, r) != q) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  printf("%d", arr[0]);
  for (int i = (1), __ = (n); i < __; ++i) printf(" %d", arr[i]);
  printf("\n");
  return 0;
}
