#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &a) {
  return out << "(" << a.first << "," << a.second << ")";
}
template <class A>
ostream &operator<<(ostream &out, const vector<A> &a) {
  for (const A &it : a) out << it << " ";
  return out;
}
template <class A, class B>
istream &operator>>(istream &in, pair<A, B> &a) {
  return in >> a.first >> a.second;
}
template <class A>
istream &operator>>(istream &in, vector<A> &a) {
  for (A &i : a) in >> i;
  return in;
}
ifstream cinn("in.txt");
ofstream coutt("out.txt");
long long poww(const long long &a, long long b,
               const long long &m = 1000000007) {
  if (b == 0) return 1;
  long long first = poww(a, b / 2, m);
  first = first * first % m;
  if (b & 1) first = first * a % m;
  return first;
}
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long rint(long long l, long long r) { return rand() % (r - l + 1) + l; }
const long long N = 5e5 + 5;
long long st[N];
vector<long long> ans(N + 1);
void build(long long n, long long l, long long r) {
  if (l == r) {
    st[n] = ans[l];
    return;
  }
  long long mid = (l + r) / 2;
  build(n * 2, l, mid);
  build((n * 2) + 1, mid + 1, r);
  st[n] = st[n * 2] & st[(n * 2) + 1];
}
long long query(long long n, long long l, long long r, long long a,
                long long b) {
  if (l > b || r < a) {
    return -1;
  } else if (l >= a && r <= b) {
    return st[n];
  }
  long long mid = (l + r) / 2;
  long long leftQuery = query(n * 2, l, mid, a, b);
  long long rightQuery = query(n * 2 + 1, mid + 1, r, a, b);
  long long q = 0;
  if (rightQuery == -1) {
    return leftQuery;
  }
  if (leftQuery == -1) {
    return rightQuery;
  }
  return leftQuery & rightQuery;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j, first;
  long long n, m;
  cin >> n >> m;
  long long bits = 31;
  set<long long> st[bits];
  for (i = 0; i < bits; i++) {
    for (j = 0; j < n + 1; j++) {
      st[i].insert(j);
    }
  }
  vector<pair<pair<long long, long long>, long long>> queries;
  for (i = 0; i < m; i++) {
    long long left, right, val;
    cin >> left >> right >> val;
    queries.push_back({{left, right}, val});
    for (j = 0; j < bits; j++) {
      if ((val & 1 << j)) {
        long long cur = left;
        auto it = st[j].lower_bound(cur);
        while ((it != st[j].end()) && (*it <= right)) {
          ans[*it] |= (1 << j);
          st[j].erase(it);
          it = st[j].lower_bound(cur);
        }
      }
    }
  }
  build(1, 1, n);
  for (i = 0; i < m; i++) {
    if (query(1, 1, n, queries[i].first.first, queries[i].first.second) !=
        queries[i].second) {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  for (long long i = 1; i < n + 1; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
