#include <bits/stdc++.h>
using namespace std;
vector<long long int> a(100005, 0), seg(4 * 100005, 0), lazy(4 * 100005, 0);
void build(long long cur, long long st, long long end) {
  if (st == end) {
    seg[cur] = a[st];
    return;
  }
  long long mid = (st + end) >> 1;
  build(2 * cur, st, mid);
  build(2 * cur + 1, mid + 1, end);
  seg[cur] = seg[2 * cur] | seg[2 * cur + 1];
}
void updaterange(long long cur, long long st, long long end, long long l,
                 long long r, long long val) {
  if (lazy[cur] != 0) {
    seg[cur] |= lazy[cur];
    if (st != end) {
      lazy[2 * cur] |= lazy[cur];
      lazy[2 * cur + 1] |= lazy[cur];
    }
    lazy[cur] = 0;
  }
  if (st > end || st > r || end < l) return;
  if (l <= st && end <= r) {
    seg[cur] |= val;
    if (st != end) {
      lazy[2 * cur] |= val;
      lazy[2 * cur + 1] |= val;
    }
    return;
  }
  long long mid = (st + end) >> 1;
  updaterange(2 * cur, st, mid, l, r, val);
  updaterange(2 * cur + 1, mid + 1, end, l, r, val);
  seg[cur] = seg[2 * cur] | seg[2 * cur + 1];
}
long long query(long long cur, long long st, long long end, long long l,
                long long r) {
  if (st > end || st > r || end < l) return 0;
  if (lazy[cur] != 0) {
    seg[cur] |= lazy[cur];
    if (st != end) {
      lazy[2 * cur] |= lazy[cur];
      lazy[2 * cur + 1] |= lazy[cur];
    }
    lazy[cur] = 0;
  }
  if (st >= l && end <= r) return seg[cur];
  long long mid = (st + end) >> 1;
  long long ans1 = query(2 * cur, st, mid, l, r);
  long long ans2 = query(2 * cur + 1, mid + 1, end, l, r);
  return ans1 | ans2;
}
vector<long long int> a2(100005), seg2(4 * 100005);
void build2(long long cur, long long st, long long end) {
  if (st == end) {
    seg2[cur] = a2[st];
    return;
  }
  long long mid = (st + end) >> 1;
  build2(2 * cur, st, mid);
  build2(2 * cur + 1, mid + 1, end);
  seg2[cur] = seg2[2 * cur] & seg2[2 * cur + 1];
}
long long query2(long long cur, long long st, long long end, long long l,
                 long long r) {
  if (l <= st && r >= end) return seg2[cur];
  if (r < st || l > end) return pow(2, 31) - 1;
  long long mid = (st + end) >> 1;
  long long ans1 = query2(2 * cur, st, mid, l, r);
  long long ans2 = query2(2 * cur + 1, mid + 1, end, l, r);
  return (ans1 & ans2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    long long int n, q;
    cin >> n >> q;
    vector<long long int> l(q), r(q), val(q);
    for (long long int i = 0; i < q; i++) {
      cin >> l[i] >> r[i] >> val[i];
    }
    build(1, 1, n);
    for (long long int i = 0; i < q; i++) {
      updaterange(1, 1, n, l[i], r[i], val[i]);
    }
    for (long long int i = 1; i <= n; i++) {
      a2[i] = query(1, 1, n, i, i);
    }
    build2(1, 1, n);
    for (long long int i = 0; i < q; i++) {
      if (query2(1, 1, n, l[i], r[i]) != val[i]) {
        cout << "NO";
        return 0;
      }
    }
    cout << "YES" << '\n';
    for (long long int i = 1; i <= n; i++) {
      cout << a2[i] << " ";
    }
  }
  return 0;
}
