#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const double PI = 4 * atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
const int MAX_N = 2e6 + 10;
int n, c;
int L[MAX_N], R[MAX_N], Q[MAX_N];
ll sum[MAX_N];
ll a[MAX_N], t[4 * MAX_N];
void build(int v, int l, int r) {
  if (l + 1 == r) {
    t[v] = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(v * 2, l, mid);
  build(v * 2 + 1, mid, r);
  t[v] = t[2 * v] & t[2 * v + 1];
}
int query(int v, int l, int r, int A, int B) {
  if (l == A and r == B) return t[v];
  int mid = (A + B) / 2;
  int ans = (1LL << 30) - 1;
  if (l < mid) ans &= query(v * 2, l, min(r, mid), A, mid);
  if (mid < r) ans &= query(v * 2 + 1, max(l, mid), r, mid, B);
  return ans;
}
void solve() {
  for (int bit = 0; bit <= 30; ++bit) {
    memset(sum, 0, sizeof(sum));
    for (int i = 0; i < c; ++i) {
      if (Q[i] >> bit & 1) {
        sum[L[i]]++;
        sum[R[i]]--;
      }
    }
    for (int i = 0; i < n; ++i) {
      if (i) sum[i] += sum[i - 1];
      if (sum[i] > 0) {
        a[i] |= (1LL << bit);
      }
    }
  }
  build(1, 0, n);
  for (int i = 0; i < c; i++) {
    if (query(1, L[i], R[i], 0, n) != Q[i]) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) {
    cout << a[i] << ' ';
  }
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> c;
  for (int i = 0; i < c; ++i) {
    cin >> L[i] >> R[i] >> Q[i];
    L[i]--;
  }
  solve();
  return 0;
}
