#include <bits/stdc++.h>
using namespace std;
template <class T>
T pmax(T a, T b) {
  return max(a, b);
}
const long long int mod = 1e9 + 7;
const long long int Maa = 3e5;
vector<long long int> edge[Maa];
long long int n, m, l[Maa], r[Maa], q[Maa], A[Maa], p[Maa], c[Maa];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> l[i] >> r[i] >> q[i];
  int b = 0;
  for (int i = 0; i < 30; i++) {
    memset(c, 0, sizeof c);
    for (int j = 0; j < m; j++)
      if ((q[j] >> i) & 1 == 1) c[l[j]]++, c[r[j] + 1]--;
    for (int j = 1; j <= n; j++)
      c[j] += c[j - 1], A[j] += c[j] > 0 ? (1 << i) : 0;
    for (int j = 1; j <= n; j++)
      if (c[j]) c[j] = 1, c[j] += c[j - 1];
    for (int j = 0; j < m; j++)
      if (((q[j] >> i) & 1) == 0 and c[r[j]] - c[l[j] - 1] == r[j] - l[j] + 1) {
        b = 1;
        break;
      }
  }
  if (b)
    cout << "NO";
  else {
    cout << "YES"
         << "\n";
    for (int i = 1; i <= n; i++) cout << A[i] << " ";
  }
}
