#include <bits/stdc++.h>
const int N = 1e5 + 20;
using namespace std;
int n, m;
int l[N], r[N], q[N], a[N], it[4 * N], s[N][30];
void build(int ind, int b, int e) {
  if (b == e) {
    it[ind] = a[b];
    return;
  }
  int mid = (b + e) / 2;
  build(2 * ind, b, mid);
  build(2 * ind + 1, mid + 1, e);
  it[ind] = it[2 * ind] & it[2 * ind + 1];
}
int query(int i, int l, int r, int x, int y) {
  if (r < x || l > y || l > r) return (1 << 30) - 1;
  if (x <= l && r <= y) return it[i];
  int m = (l + r) / 2;
  return query(i * 2, l, m, x, y) & query(i * 2 + 1, m + 1, r, x, y);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j < 30; j++) s[i][j] = 0;
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    int k = q[i];
    for (int j = 0; j < 30; j++, k /= 2) {
      if (k % 2) {
        s[l[i]][j]++;
        s[r[i] + 1][j]--;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    a[i] = 0;
    int k = 1;
    for (int j = 0; j < 30; j++, k *= 2) {
      s[i][j] += s[i - 1][j];
      if (s[i][j] > 0) a[i] += k;
    }
  }
  build(1, 1, n);
  while (m--) {
    if (query(1, 1, n, l[m], r[m]) != q[m]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
