#include <bits/stdc++.h>
const long long INFLL = 2 * 1e18 + 100;
const int INFINT = 2 * 1e9 + 100;
using namespace std;
void die() {
  cout << "NO";
  exit(0);
}
const int NMAX = 1e5 + 5;
const int MOD = 1e8;
const double PI = atan(1) * 4;
const double EPS = 1e-12;
int n, m;
struct query {
  int l, r, q;
};
vector<query> questions;
const int BITMAX = 30;
int v[NMAX], sum[NMAX];
int aint[4 * NMAX];
void build(int nod, int l, int r) {
  if (l == r) {
    aint[nod] = v[l];
    return;
  }
  int m = (l + r) / 2;
  build(2 * nod, l, m);
  build(2 * nod + 1, m + 1, r);
  aint[nod] = (aint[2 * nod] & aint[2 * nod + 1]);
}
int _query(int nod, int l, int r, int start, int finish) {
  if (start <= l && finish >= r) return aint[nod];
  int m = (l + r) / 2;
  int ret = (1 << BITMAX) - 1;
  if (start <= m) ret &= _query(2 * nod, l, m, start, finish);
  if (finish > m) ret &= _query(2 * nod + 1, m + 1, r, start, finish);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    query temp;
    cin >> temp.l >> temp.r >> temp.q;
    questions.push_back(temp);
  }
  for (int bit = 0; bit < BITMAX + 1; bit++) {
    for (int i = 1; i <= n; i++) sum[i] = 0;
    for (auto i : questions)
      if ((i.q >> bit) & 1) {
        sum[i.l]++;
        sum[i.r + 1]--;
      }
    for (int i = 1; i <= n; i++) {
      sum[i] += sum[i - 1];
      if (sum[i] > 0) v[i] |= (1 << bit);
    }
  }
  build(1, 1, n);
  for (auto i : questions)
    if (i.q != _query(1, 1, n, i.l, i.r)) return cout << "NO", 0;
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << v[i] << ' ';
  return 0;
}
