#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a = a % 1000000007;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
      b--;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  return (b == 0) ? a : gcd(b, a % b);
}
vector<long long int> a(100005, 0);
vector<long long int> tree(500005, 0);
long long int n, m;
void build(long long int l, long long int r, long long int v) {
  if (l == r)
    tree[v] = a[l];
  else {
    long long int mid = l + (r - l) / 2;
    build(l, mid, 2 * v);
    build(mid + 1, r, 2 * v + 1);
    tree[v] = (tree[2 * v] & tree[2 * v + 1]);
  }
}
long long int x = 0;
long long int sum(long long int tl, long long int tr, long long int l,
                  long long int r, long long int v) {
  if (l > r) return x;
  long long int mid = tl + (tr - tl) / 2;
  if (tl == l && tr == r) return tree[v];
  return (sum(tl, mid, l, min(mid, r), 2 * v) &
          sum(mid + 1, tr, max(mid + 1, l), r, 2 * v + 1));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (long long int i = 0; i <= 30; i++) x += (1 << i);
  vector<pair<pair<long long int, long long int>, long long int>> v(m);
  for (long long int i = 0; i < m; i++) {
    cin >> v[i].first.first >> v[i].first.second >> v[i].second;
  }
  for (long long int i = 0; i <= 30; i++) {
    vector<long long int> sum(n + 2, 0);
    for (auto j : v) {
      if ((j.second & (1 << i)) == 0) continue;
      sum[j.first.first] += 1;
      sum[j.first.second + 1] -= 1;
    }
    for (long long int j = 1; j <= n; j++) sum[j] += sum[j - 1];
    for (long long int j = 1; j <= n; j++) {
      if (sum[j]) a[j] |= (1 << i);
    }
  }
  build(1, n, 1);
  for (auto i : v) {
    if (sum(1, n, i.first.first, i.first.second, 1) != i.second) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (long long int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
}
