#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int inf = 1e9;
struct Node {
  Node *l = 0, *r = 0;
  int lo, hi, mset = 0, val = 0;
  Node(int lo, int hi) : lo(lo), hi(hi) {
    if (lo < hi) {
      int mid = lo + (hi - lo) / 2;
      l = new Node(lo, mid);
      r = new Node(mid + 1, hi);
    }
  }
  int query(int L, int R) {
    if (R < lo || hi < L) return 0xFFFFFFFF;
    if (L <= lo && hi <= R) {
      return val;
    }
    push();
    return l->query(L, R) & r->query(L, R);
  }
  void set(int L, int R, int x) {
    if (R < lo || hi < L) return;
    if (L <= lo && hi <= R) {
      mset |= x;
    } else {
      push();
      l->set(L, R, x);
      r->set(L, R, x);
      val = l->val & r->val;
    }
  }
  void push() {
    if (!l and hi > lo) {
      int mid = lo + (hi - lo) / 2;
      l = new Node(lo, mid);
      r = new Node(mid, hi);
    }
    if (mset) {
      if (l) {
        l->set(lo, hi, mset);
        r->set(lo, hi, mset);
      }
      if (hi == lo) val = mset;
    }
  }
  void prepare() {
    push();
    if (l) {
      l->prepare();
      r->prepare();
      val = l->val & r->val;
    } else
      val = mset;
  }
  void fill(vector<int>& a) {
    if (lo == hi)
      a[lo] = val;
    else {
      l->fill(a);
      r->fill(a);
    }
  }
  void print() {
    cout << lo << " " << hi << " " << val << " " << mset << "\n";
    if (l) {
      l->print();
      r->print();
    }
  }
};
struct query {
  int l, r, q;
};
void fail() {
  cout << "NO"
       << "\n";
  exit(0);
}
int32_t main() {
  int n, m;
  cin >> n >> m;
  vector<query> q(m);
  Node* tr = new Node(0, n - 1);
  for (auto& x : q) {
    cin >> x.l >> x.r >> x.q;
    x.l--;
    x.r--;
    tr->set(x.l, x.r, x.q);
  }
  tr->prepare();
  for (auto& x : q) {
    if (tr->query(x.l, x.r) != x.q) {
      fail();
    }
  }
  vector<int> res(n);
  tr->fill(res);
  cout << "YES"
       << "\n";
  for (int i : res) cout << i << " ";
  cout << "\n";
  return 0;
}
