#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
const int MOD = 2333;
const double eps = 1e-6;
using namespace std;
int bit[MAXN << 2], AND[MAXN << 2], l[MAXN], r[MAXN], q[MAXN];
void pushdown(int rt) {
  if (bit[rt]) {
    bit[rt << 1] |= bit[rt];
    bit[rt << 1 | 1] |= bit[rt];
    AND[rt << 1] |= bit[rt];
    AND[rt << 1 | 1] |= bit[rt];
    bit[rt] = 0;
  }
}
void pushup(int rt) { AND[rt] = AND[rt << 1] & AND[rt << 1 | 1]; }
void updata(int num, int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) {
    bit[rt] |= num;
    AND[rt] |= num;
    return;
  }
  pushdown(rt);
  int m = l + r >> 1;
  if (L <= m) updata(num, L, R, l, m, rt << 1);
  if (m < R) updata(num, L, R, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
int query(int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) return AND[rt];
  pushdown(rt);
  int m = l + r >> 1;
  int res = (1 << 30) - 1;
  if (L <= m) res &= query(L, R, l, m, rt << 1);
  if (m < R) res &= query(L, R, m + 1, r, rt << 1 | 1);
  return res;
}
void solve(int l, int r, int rt) {
  if (l == r) {
    cout << AND[rt] << " ";
    return;
  }
  pushdown(rt);
  int m = l + r >> 1;
  solve(l, m, rt << 1);
  solve(m + 1, r, rt << 1 | 1);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> l[i] >> r[i] >> q[i];
    updata(q[i], l[i], r[i], 1, n, 1);
  }
  for (int i = 0; i < m; ++i)
    if (query(l[i], r[i], 1, n, 1) != q[i]) return cout << "NO", 0;
  cout << "YES" << endl;
  solve(1, n, 1);
  return 0;
}
