#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& output, vector<T>& v) {
  output << "[ ";
  if (int(v.size())) {
    output << v[0];
  }
  for (int i = 1; i < int(v.size()); i++) {
    output << ", " << v[i];
  }
  output << " ]";
  return output;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& output, pair<T1, T2>& p) {
  output << "( " << p.first << ", " << p.second << " )";
  return output;
}
template <typename T>
ostream& operator,(ostream& output, T x) {
  output << x << " ";
  return output;
}
int bitMat[32][100007];
int comuZeroBit[32][100007];
vector<pair<int, int> > v[32];
int main() {
  int n, m;
  int l, r, q;
  cin >> n >> m;
  for (int tmp = 0; tmp < m; tmp++) {
    cin >> l >> r >> q;
    for (int i = 0; i < 32; i++) {
      if ((q & (1 << i))) {
        bitMat[i][l]++;
        bitMat[i][r + 1]--;
      } else {
        v[i].push_back(make_pair(l, r));
      }
    }
  }
  for (int i = 0; i < 32; i++) {
    int sum = 0;
    for (int j = 1; j <= n; j++) {
      sum += bitMat[i][j];
      if (sum > 0) {
        bitMat[i][j] = 1;
      } else {
        comuZeroBit[i][j] = 1;
      }
      comuZeroBit[i][j] += comuZeroBit[i][j - 1];
    }
  }
  bool pos = 1;
  for (int i = 0; i < 32; i++) {
    for (int j = 0; j < int(v[i].size()); j++) {
      l = v[i][j].first;
      r = v[i][j].second;
      if ((comuZeroBit[i][r] - comuZeroBit[i][l - 1]) == 0) {
        pos = false;
      }
    }
  }
  if (pos) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      int num = 0;
      for (int j = 0; j < 32; j++) {
        if (bitMat[j][i] == 1) {
          num = num | (1 << j);
        }
      }
      cout << num << ' ';
    }
  } else {
    cout << "NO" << endl;
  }
}
