#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
inline long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
inline long long power(long long a, long long n, long long m) {
  if (n == 0) return 1;
  long long p = power(a, n / 2, m);
  p = (p * p) % m;
  if (n % 2)
    return (p * a) % m;
  else
    return p;
}
const long long MOD = 1000000009;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
int mask = (1 << 30) - 1;
struct Query {
  int l;
  int r;
  int q;
};
const int N = 200001;
int st[4 * N];
int lazy[4 * N];
int st1[4 * N];
int a[N];
void constructtree(int i, int l, int r) {
  if (l > r) return;
  if (l == r) {
    st1[i] = a[l];
    return;
  }
  int m = (l + r) / 2;
  constructtree(2 * i + 1, l, m);
  constructtree(2 * i + 2, m + 1, r);
  st1[i] = st1[2 * i + 1] & st1[2 * i + 2];
}
int query2(int i, int l, int r, int qs, int qe) {
  if (qs > r || qe < l) return mask;
  if (qs <= l && qe >= r) return st1[i];
  int m = (l + r) / 2;
  return query2(2 * i + 1, l, m, qs, qe) & query2(2 * i + 2, m + 1, r, qs, qe);
}
void update(int i, int l, int r, int qs, int qe, int v) {
  if (lazy[i] != 0) {
    st[i] |= lazy[i];
    if (l != r) {
      lazy[2 * i + 1] |= lazy[i];
      lazy[2 * i + 2] |= lazy[i];
    }
    lazy[i] = 0;
  }
  if (qs > r || qe < l) return;
  if (qs <= l && qe >= r) {
    st[i] |= v;
    if (l != r) {
      lazy[2 * i + 1] |= v;
      lazy[2 * i + 2] |= v;
    }
    lazy[i] = 0;
    return;
  }
  int m = (l + r) / 2;
  update(2 * i + 1, l, m, qs, qe, v);
  update(2 * i + 2, m + 1, r, qs, qe, v);
  st[i] = st[2 * i + 1] | st[2 * i + 2];
}
int query(int i, int l, int r, int qs, int qe) {
  if (lazy[i] != 0) {
    st[i] |= lazy[i];
    if (l != r) {
      lazy[2 * i + 1] |= lazy[i];
      lazy[2 * i + 2] |= lazy[i];
    }
    lazy[i] = 0;
  }
  if (qs > r || qe < l) return 0;
  if (qs <= l && qe >= r) return st[i];
  int m = (l + r) / 2;
  return query(2 * i + 1, l, m, qs, qe) | query(2 * i + 2, m + 1, r, qs, qe);
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m;
  int ans;
  cin >> n >> m;
  Query queries[m];
  for (int i = 0; i < m; i++) {
    cin >> queries[i].l;
    cin >> queries[i].r;
    cin >> queries[i].q;
    update(0, 0, n - 1, queries[i].l - 1, queries[i].r - 1, queries[i].q);
  }
  for (int i = 0; i < n; i++) {
    a[i] = query(0, 0, n - 1, i, i);
  }
  constructtree(0, 0, n - 1);
  for (int i = 0; i < m; i++) {
    ans = query2(0, 0, n - 1, queries[i].l - 1, queries[i].r - 1);
    if (ans != queries[i].q) {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  cout << "YES"
       << "\n";
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
  return 0;
}
