#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const long long INF = (1ll << 32) - 1;
long long sum[maxn << 2], add[maxn << 2];
int n, m;
struct Node {
  int l, r;
  long long q;
} nd[maxn];
void Pushup(int root);
void Pushdown(int root);
void update(long long q, int L, int R, int left, int right, int root);
long long query(int L, int R, int left, int right, int root);
void print(int left, int right, int root);
int main() {
  while (cin >> n >> m) {
    int flag = 1;
    memset(sum, 0, sizeof(sum));
    for (int i = 0; i < m; i++)
      scanf("%d%d%I64d", &nd[i].l, &nd[i].r, &nd[i].q);
    for (int i = 0; i < m; i++) update(nd[i].q, nd[i].l, nd[i].r, 1, n, 1);
    for (int i = 0; i < m; i++)
      if (nd[i].q != query(nd[i].l, nd[i].r, 1, n, 1)) {
        flag = 0;
        break;
      }
    if (flag) {
      cout << "YES" << endl;
      print(1, n, 1);
    } else
      cout << "NO" << endl;
  }
  return 0;
}
void Pushup(int root) { sum[root] = sum[root << 1] & sum[root << 1 | 1]; }
void Pushdown(int root) {
  if (add[root]) {
    sum[root << 1] |= add[root];
    sum[root << 1 | 1] |= add[root];
    add[root << 1] |= add[root];
    add[root << 1 | 1] |= add[root];
    add[root] = 0;
  }
}
void update(long long q, int L, int R, int left, int right, int root) {
  if (L <= left && right <= R) {
    add[root] |= q;
    sum[root] |= q;
    return;
  }
  Pushdown(root);
  int mid = (left + right) >> 1;
  if (L <= mid) update(q, L, R, left, mid, root << 1);
  if (R > mid) update(q, L, R, mid + 1, right, root << 1 | 1);
  Pushup(root);
}
long long query(int L, int R, int left, int right, int root) {
  if (L <= left && right <= R) {
    return sum[root];
  }
  Pushdown(root);
  int mid = (left + right) >> 1;
  long long ret = INF;
  if (L <= mid) ret &= query(L, R, left, mid, root << 1);
  if (R > mid) ret &= query(L, R, mid + 1, right, root << 1 | 1);
  Pushup(root);
  return ret;
}
void print(int left, int right, int root) {
  if (left == right) {
    printf("%I64d%c", sum[root], left == n ? '\n' : ' ');
    return;
  }
  Pushdown(root);
  int mid = (left + right) >> 1;
  print(left, mid, root << 1);
  print(mid + 1, right, root << 1 | 1);
}
