#include <bits/stdc++.h>
using namespace std;
long long int seg[800005], lazy[800005];
void push(long long int v) {
  if (lazy[v] == 0) return;
  seg[2 * v] |= lazy[v];
  seg[2 * v + 1] |= lazy[v];
  lazy[2 * v] = lazy[v];
  lazy[2 * v + 1] = lazy[v];
  lazy[v] = 0;
  return;
}
void update(long long int v, long long int tl, long long int tr,
            long long int l, long long int r, long long int val) {
  if (tl > r || tr < l) return;
  push(v);
  if (tl == l && tr == r) {
    lazy[v] = val;
    seg[v] = val;
    return;
  } else if (tl >= l && tr <= r) {
    lazy[v] = val;
    seg[v] |= val;
    return;
  }
  long long int tm = (tl + tr) / 2;
  update(2 * v, tl, tm, l, r, val);
  update(2 * v + 1, tm + 1, tr, l, r, val);
  seg[v] = (seg[2 * v] & seg[2 * v + 1]);
  return;
}
long long int query(long long int v, long long int tl, long long int tr,
                    long long int l, long long int r) {
  if (tl > r || tr < l) return (1LL << 40) - 1;
  push(v);
  if (tl >= l && tr <= r) {
    return seg[v];
  }
  long long int tm = (tl + tr) / 2;
  return (query(2 * v, tl, tm, l, r) & query(2 * v + 1, tm + 1, tr, l, r));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tests = 1;
  while (tests--) {
    long long int i, j, n, m;
    cin >> n >> m;
    vector<long long int> l(m), r(m), q(m);
    vector<vector<long long int>> cnt(n + 2, vector<long long int>(31, 0));
    for (long long int i = 0; i <= m - 1; i++) {
      cin >> l[i] >> r[i] >> q[i];
      for (long long int j = 0; j <= 30; j++) {
        if (q[i] & (1 << j)) cnt[l[i]][j]++, cnt[r[i] + 1][j]--;
      }
    }
    for (long long int i = 1; i <= n; i++) {
      for (long long int j = 0; j <= 30; j++) cnt[i][j] += cnt[i - 1][j];
    }
    for (long long int i = 1; i <= n; i++) {
      long long int val = 0;
      for (long long int j = 0; j <= 30; j++) {
        if (cnt[i][j] > 0) val |= (1 << j);
      }
      update(1, 1, n, i, i, val);
    }
    bool check = true;
    for (long long int i = 0; i <= m - 1; i++) {
      long long int val = query(1, 1, n, l[i], r[i]);
      if (val != q[i]) {
        check = false;
        break;
      }
    }
    if (!check) {
      cout << "NO";
      return 0;
    }
    cout << "YES"
         << "\n";
    for (long long int i = 1; i <= n; i++) {
      cout << query(1, 1, n, i, i) << " ";
    }
  }
  return 0;
}
