#include <bits/stdc++.h>
using namespace std;
int n, m;
int tree[400005];
bool flag;
struct q {
  int l, r, q;
} q[100005];
void add(int l, int r, int q, int L, int R, int i) {
  if (l == L && r == R) {
    tree[i] = tree[i] | q;
    return;
  }
  int M = (L + R) / 2;
  if (r <= M)
    add(l, r, q, L, M, i * 2);
  else if (l > M)
    add(l, r, q, M + 1, R, i * 2 + 1);
  else {
    add(l, M, q, L, M, i * 2);
    add(M + 1, r, q, M + 1, R, i * 2 + 1);
  }
}
int AND(int l, int r, int L, int R, int i) {
  if (l == L && r == R) return tree[i];
  int M = (L + R) / 2;
  if (r <= M) return AND(l, r, L, M, i * 2);
  if (l > M) return AND(l, r, M + 1, R, i * 2 + 1);
  return AND(l, M, L, M, i * 2) & AND(M + 1, r, M + 1, R, i * 2 + 1);
}
int read(int f, int l, int r, int i) {
  if (l == r) return tree[i];
  int M = (l + r) / 2;
  if (f <= M) return tree[i] | read(f, l, M, i * 2);
  if (f > M) return tree[i] | read(f, M + 1, r, i * 2 + 1);
}
int main() {
  int k = 1;
  while (cin >> n >> m) {
    memset(tree, 0, sizeof(tree));
    flag = 0;
    for (int i = 0; i < m; i++) {
      scanf("%d %d %d", &q[i].l, &q[i].r, &q[i].q);
      q[i].l--;
      q[i].r--;
    }
    for (int i = 0; i < m; i++) add(q[i].l, q[i].r, q[i].q, 0, n - 1, 1);
    for (int i = 0; i < m; i++)
      if (AND(q[i].l, q[i].r, 0, n - 1, 1) != q[i].q) flag = 1;
    if (flag)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) {
        if (i) printf(" ");
        printf("%d", read(i, 0, n - 1, 1));
      }
      printf("\n");
    }
  }
  return 0;
}
