#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10, mod = 1e9 + 7;
long long tree[4 * N], lazy[4 * N], n, m, l[N], r[N], q[N];
void updateRange(int node, int start, int end, int l, int r, int val) {
  if (lazy[node] != 0) {
    tree[node] |= lazy[node];
    if (start != end) {
      lazy[node * 2] |= lazy[node];
      lazy[node * 2 + 1] |= lazy[node];
    }
    lazy[node] = 0;
  }
  if (start > r || end < l) return;
  if (start >= l and end <= r) {
    tree[node] |= val;
    if (start != end) {
      lazy[node * 2] |= val;
      lazy[node * 2 + 1] |= val;
    }
    return;
  }
  int mid = (start + end) / 2;
  updateRange(node * 2, start, mid, l, r, val);
  updateRange(node * 2 + 1, mid + 1, end, l, r, val);
  tree[node] = (tree[node * 2] & tree[node * 2 + 1]);
}
long long queryRange(int node, int start, int end, int l, int r) {
  if (start > r || end < l) return (1 << 30) - 1;
  if (lazy[node] != 0) {
    tree[node] |= lazy[node];
    if (start != end) {
      lazy[node * 2] |= lazy[node];
      lazy[node * 2 + 1] |= lazy[node];
    }
    lazy[node] = 0;
  }
  if (start >= l and end <= r) {
    return tree[node];
  }
  int mid = (start + end) / 2;
  long long p1 = queryRange(node * 2, start, mid, l, r);
  long long p2 = queryRange(node * 2 + 1, mid + 1, end, l, r);
  return (p1 & p2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    updateRange(1, 1, N, l[i], r[i], q[i]);
  }
  for (int i = 0; i < m; i++) {
    if (queryRange(1, 1, N, l[i], r[i]) != q[i]) {
      return cout << "NO\n", 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << queryRange(1, 1, N, i + 1, i + 1) << ' ';
  }
}
