#include <bits/stdc++.h>
using namespace std;
const int MAX = 4e5 + 10;
int n, m, seg[4 * MAX], fen[33][MAX];
vector<pair<int, int> > v[33];
int res[MAX];
struct node {
  node(int xx, int yy, int zz) {
    X = xx;
    Y = yy;
    Z = zz;
  }
  int X, Y, Z;
};
vector<node> Q;
void upd(int a, int b, int c) {
  while (b <= n) {
    fen[a][b] += c;
    b += (b & -b);
  }
}
int get(int a, int b) {
  int ret = 0;
  while (b > 0) {
    ret += fen[a][b];
    b -= (b & -b);
  }
  return ret;
}
int make(int a, int l, int r) {
  if (l + 1 == r) return seg[a] = res[l];
  int m = (l + r) / 2;
  int u = make(2 * a, l, m);
  int v = make(2 * a + 1, m, r);
  return seg[a] = u & v;
}
int ok(int a, int ll, int rr, int l, int r) {
  if (ll == l && rr == r) return seg[a];
  int mm = (ll + rr) / 2;
  if (r <= mm) return ok(2 * a, ll, mm, l, r);
  if (l >= mm) return ok(2 * a + 1, mm, rr, l, r);
  return ok(2 * a, ll, mm, l, mm) & ok(2 * a + 1, mm, rr, mm, r);
}
bool check() {
  for (int i = 0; i < Q.size(); i++) {
    node tmp = Q[i];
    if (ok(1, 1, n + 1, tmp.X, tmp.Y + 1) != tmp.Z) return false;
  }
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int l, r, q;
    cin >> l >> r >> q;
    Q.push_back(node(l, r, q));
    for (int j = 0; j < 30; j++)
      if (1 << j & q) v[j].push_back(pair<int, int>(l, r));
  }
  for (int b = 0; b < 30; b++) {
    for (int i = 0; i < v[b].size(); i++) {
      pair<int, int> tmp = v[b][i];
      upd(b, tmp.first, 1);
      upd(b, tmp.second + 1, -1);
    }
  }
  for (int i = 1; i <= n; i++) {
    int num = 0;
    for (int b = 0; b < 30; b++) {
      int cur = get(b, i);
      if (cur > 0) num += (1 << b);
    }
    res[i] = num;
  }
  make(1, 1, n + 1);
  if (!check()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << res[i] << ' ';
  cout << '\n';
  return 0;
}
