#include <bits/stdc++.h>
using namespace std;
int n, m, cum[31][100100], a[100100], seg[4 * 100100];
pair<int, pair<int, int> > pr[100100];
void build(int p, int l, int r) {
  if (l == r) {
    seg[p] = a[l];
    return;
  }
  int md = (l + r) >> 1;
  build(p * 2, l, md);
  build(p * 2 + 1, md + 1, r);
  seg[p] = seg[p * 2] & seg[p * 2 + 1];
}
int get(int p, int l, int r, int a, int b) {
  if (a <= l and r <= b) return seg[p];
  if (r < a or l > b) return (1 << 30) - 1;
  int md = (l + r) >> 1;
  int r1 = get(p * 2, l, md, a, b);
  int r2 = get(p * 2 + 1, md + 1, r, a, b);
  return r1 & r2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> pr[i].first >> pr[i].second.first >> pr[i].second.second;
    for (int j = 0; j < 31; ++j) {
      if ((pr[i].second.second & (1 << j)) != 0) {
        ++cum[j][pr[i].first];
        --cum[j][pr[i].second.first + 1];
      }
    }
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < 31; ++j) cum[j][i] += cum[j][i - 1];
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < 31; ++j)
      if (cum[j][i] > 0) a[i] |= (1 << j);
  build(1, 1, n);
  for (int i = 0; i < m; ++i) {
    if (get(1, 1, n, pr[i].first, pr[i].second.first) != pr[i].second.second)
      return cout << "NO\n", 0;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; ++i) cout << a[i] << " ";
  cout << endl;
  return 0;
}
