#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& _p) {
  return os << "(" << _p.first << "," << _p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& _V) {
  bool f = true;
  os << "[";
  for (auto v : _V) {
    os << (f ? "" : ",") << v;
    f = false;
  }
  return os << "]";
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& _S) {
  bool f = true;
  os << "(";
  for (auto s : _S) {
    os << (f ? "" : ",") << s;
    f = false;
  }
  return os << ")";
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const map<T, U>& _M) {
  return os << set<pair<T, U>>(_M.begin(), _M.end());
}
const signed long long INF = 1000000100;
const long double EPS = 1e-9;
struct tree {
  int M;
  int* T;
  tree(int n) : M(1 << (32 - __builtin_clz(n))), T(new int[2 * M]) {
    for (int(i) = (0); (i) < (2 * M); (i)++) T[i] = 0;
  }
  void insert(int a, int b, int t) {
    a += M;
    b += M;
    T[a] |= t;
    T[b] |= t;
    while (a / 2 != b / 2) {
      if (a % 2 == 0) T[a + 1] |= t;
      if (b % 2 == 1) T[b - 1] |= t;
      a /= 2;
      b /= 2;
    }
  }
  int query(int a) {
    a += M;
    int ret = 0;
    while (a != 0) {
      ret |= T[a];
      a /= 2;
    }
    return ret;
  }
  void insert(int a, int t) {
    a += M;
    T[a] = t;
    a /= 2;
    while (a != 0) {
      T[a] = (T[2 * a] & T[2 * a + 1]);
      a /= 2;
    }
  }
  int query(int a, int b) {
    a += M;
    b += M;
    int ret = (T[a] & T[b]);
    while (a / 2 != b / 2) {
      if (a % 2 == 0) ret &= T[a + 1];
      if (b % 2 == 1) ret &= T[b - 1];
      a /= 2;
      b /= 2;
    }
    return ret;
  }
};
const int MAXN = 300300;
int N, Q;
int A[MAXN];
int B[MAXN];
int first[MAXN];
void read_data() {
  scanf("%d %d", &N, &Q);
  for (int(i) = (1); (i) <= (Q); (i)++)
    scanf("%d %d %d", A + i, B + i, first + i);
}
void solve() {
  tree T1(N);
  for (int(i) = (1); (i) <= (Q); (i)++) T1.insert(A[i], B[i], first[i]);
  tree T2(N);
  for (int(i) = (1); (i) <= (N); (i)++) T2.insert(i, T1.query(i));
  bool ok = true;
  for (int(i) = (1); (i) <= (Q); (i)++)
    ok &= (T2.query(A[i], B[i]) == first[i]);
  printf(ok ? "YES\n" : "NO\n");
  if (ok) {
    for (int(i) = (1); (i) <= (N); (i)++) printf("%d ", T1.query(i));
    printf("\n");
  }
}
int main() {
  read_data();
  solve();
}
