#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
long long T[N << 2];
long long L[N << 2];
void refresh(int x) {
  T[x] |= L[x];
  L[2 * x] |= L[x];
  L[2 * x + 1] |= L[x];
  L[x] = 0;
}
void update(int l, int r, int x, int a, int b, long long v) {
  refresh(x);
  if (l > b || r < a || l > r) return;
  if (l >= a && r <= b) {
    L[x] |= v;
    return;
  }
  int mid = (l + r) / 2;
  update(l, mid, x * 2, a, b, v);
  update(mid + 1, r, x * 2 + 1, a, b, v);
  T[x] = T[x * 2] & T[x * 2 + 1];
}
long long query(int l, int r, int x, int a, int b) {
  refresh(x);
  if (l > b || r < a || l > r) return (1LL << 50) - 1;
  ;
  if (l >= a && r <= b) return T[x];
  int mid = (l + r) / 2;
  long long q1 = query(l, mid, x * 2, a, b);
  long long q2 = query(mid + 1, r, x * 2 + 1, a, b);
  return q1 & q2;
}
long long Q[100009][3];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  while (cin >> n >> m) {
    memset(T, 0, sizeof(T));
    memset(L, 0, sizeof(L));
    for (int i = (0); i < (m); i++)
      for (int j = (0); j < (3); j++) cin >> Q[i][j];
    for (int i = (0); i < (m); i++)
      update(0, n - 1, 1, Q[i][0] - 1, Q[i][1] - 1, Q[i][2]);
    bool ok = 1;
    for (int i = (0); i < (m); i++)
      ok &= query(0, n - 1, 1, Q[i][0] - 1, Q[i][1] - 1) == Q[i][2];
    if (!ok)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int i = (0); i < (n); i++) cout << query(0, n - 1, 1, i, i) << " ";
      cout << endl;
    }
  }
  return 0;
}
