#include <bits/stdc++.h>
#pragma comment(linker, "/stack:32000000")
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 4 * 100010;
int T[maxn];
int N;
int query(int l, int r) {
  int ans = ~0;
  for (l += N, r += N; l <= r; l = (l + 1) >> 1, r = (r - 1) >> 1)
    ans &= T[l] & T[r];
  return ans;
}
int t[maxn];
int tor[maxn];
void push(int v, int L, int R) {
  t[v] |= tor[v];
  if (L < R) tor[v + v + 1] |= tor[v], tor[v + v + 2] |= tor[v];
  tor[v] = 0;
}
void modify(int v, int L, int R, int l, int r, int val) {
  if (l > R || L > r) return;
  if (l <= L && R <= r)
    tor[v] |= val;
  else {
    push(v, L, R);
    int m = (L + R) >> 1;
    modify(v + v + 1, L, m, l, r, val);
    modify(v + v + 2, m + 1, R, l, r, val);
  }
}
int a[maxn];
void build(int v, int L, int R) {
  push(v, L, R);
  if (L == R)
    a[L] = t[v];
  else {
    int m = (L + R) >> 1;
    build(v + v + 1, L, m);
    build(v + v + 2, m + 1, R);
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<pair<pair<int, int>, int> > q;
  for (int i = 0; i < m; ++i) {
    int ql, qr, qval;
    scanf("%d%d%d", &ql, &qr, &qval), --ql, --qr;
    modify(0, 0, n - 1, ql, qr, qval);
    q.push_back(make_pair(make_pair(ql, qr), qval));
  }
  build(0, 0, n - 1);
  N = n;
  for (int i = 0; i < N; ++i) T[i + N] = a[i];
  for (int i = N - 1; i; --i) T[i] = T[i + i] & T[i + i + 1];
  for (int i = 0; i < m; ++i) {
    if (query(q[i].first.first, q[i].first.second) != q[i].second) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) printf("%d ", a[i]);
  return 0;
}
