#include <bits/stdc++.h>
using namespace std;
long long a[100005], n, i, l[100005], r[100005], value, qu, q[100005],
    lazy[400005];
long long st[400005];
void update(long long node, long long start, long long end, long long l,
            long long r, long long value) {
  if (lazy[node] != 0) {
    st[node] |= lazy[node];
    if (start != end) {
      lazy[2 * node + 1] |= lazy[node];
      lazy[2 * node + 2] |= lazy[node];
    }
    lazy[node] = 0;
  }
  if (l > end || r < start) {
    return;
  }
  if (l <= start && r >= end) {
    st[node] |= value;
    if (start != end) {
      lazy[2 * node + 1] |= value;
      lazy[2 * node + 2] |= value;
    }
    return;
  }
  long long mid = (start + end) / 2;
  update(2 * node + 1, start, mid, l, r, value);
  update(2 * node + 2, mid + 1, end, l, r, value);
  st[node] = st[2 * node + 1] & st[2 * node + 2];
}
long long rmq(long long node, long long start, long long end, long long l,
              long long r) {
  if (lazy[node] != 0) {
    st[node] |= lazy[node];
    if (start != end) {
      lazy[2 * node + 1] |= lazy[node];
      lazy[2 * node + 2] |= lazy[node];
    }
    lazy[node] = 0;
  }
  long long mid = (start + end) / 2;
  if (l <= start && r >= end) {
    return st[node];
  }
  if (r <= mid) {
    return rmq(2 * node + 1, start, mid, l, r);
  }
  if (l > mid) {
    return rmq(2 * node + 2, mid + 1, end, l, r);
  }
  long long left = rmq(2 * node + 1, start, mid, l, r);
  long long right = rmq(2 * node + 2, mid + 1, end, l, r);
  return left & right;
}
int main() {
  scanf("%lld%lld", &n, &qu);
  for (i = 0; i < qu; i++) {
    scanf("%lld%lld%lld", &l[i], &r[i], &q[i]);
    l[i]--;
    r[i]--;
    update(0, 0, n - 1, l[i], r[i], q[i]);
  }
  for (i = 0; i < qu; i++) {
    if (rmq(0, 0, n - 1, l[i], r[i]) != q[i]) {
      cout << "NO" << endl;
      exit(0);
    }
  }
  cout << "YES" << endl;
  for (i = 0; i < n; i++) {
    cout << rmq(0, 0, n - 1, i, i) << " ";
  }
  cout << endl;
  return 0;
}
