#include <bits/stdc++.h>
using namespace std;
struct _ {
  ios_base::Init i;
  _() {
    cin.sync_with_stdio(0);
    cin.tie(0);
  }
} _;
int n, m;
const int N = 100 * 1000 + 1;
int l[N], r[N], q[N], sum[N];
int MAXBIT = 30;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> l[i] >> r[i] >> q[i];
    r[i]++;
  }
  vector<int> a(n + 1, 0);
  for (int bit = 0; bit < MAXBIT; ++bit) {
    int curBit = 1 << bit;
    for (int i = 0; i < n + 1; ++i) sum[i] = 0;
    for (int i = 0; i < m; ++i) {
      if (q[i] & curBit) {
        sum[l[i]]++;
        sum[r[i]]--;
      }
    }
    for (int i = 2; i < n + 1; ++i) sum[i] += sum[i - 1];
    for (int i = 1; i < n + 1; ++i) {
      if (sum[i] > 0) {
        sum[i] = 1;
        a[i] |= curBit;
      }
      sum[i] += sum[i - 1];
    }
    for (int i = 0; i < m; ++i) {
      bool hasBit = q[i] & curBit;
      int cnt = sum[r[i] - 1] - sum[l[i] - 1];
      if ((hasBit && cnt != (r[i] - l[i])) ||
          (!hasBit && cnt == (r[i] - l[i]))) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i < n + 1; ++i) cout << a[i] << " ";
  cout << endl;
  return 0;
}
