#include <bits/stdc++.h>
#pragma optimization_level 3
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 1e+9 + 7;
const ll INF = LLONG_MAX;
const int N = (int)2e+5 + 8;
ll n, m, a[N], l[N], r[N], x[N];
ll pre[50][N];
void MAIN(int tc) {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> l[i] >> r[i] >> x[i];
    for (int j = 0; j < 30; j++) {
      if ((1LL << j) & x[i]) {
        pre[j][l[i]]++;
        pre[j][r[i] + 1]--;
      }
    }
  }
  for (int i = 0; i < 30; i++) {
    for (int j = 1; j <= n; j++) {
      pre[i][j] += pre[i][j - 1];
    }
  }
  for (int i = 0; i < 30; i++) {
    for (int j = 1; j <= n; j++) {
      pre[i][j] = (pre[i][j] > 0);
    }
  }
  for (int i = 0; i < 30; i++) {
    for (int j = 1; j <= n; j++) {
      pre[i][j] += pre[i][j - 1];
    }
  }
  for (int i = 1; i <= m; i++) {
    ll ans = 0;
    for (int j = 0; j < 30; j++) {
      ll v = pre[j][r[i]] - pre[j][l[i] - 1];
      if (v == r[i] - l[i] + 1) ans |= (1LL << j);
    }
    if (x[i] != ans) {
      cout << "NO"
           << "\n";
      ;
      return;
    }
  }
  cout << "YES"
       << "\n";
  ;
  for (int i = 1; i <= n; i++) {
    ll ans = 0;
    for (int j = 0; j < 30; j++) {
      ll v = pre[j][i] - pre[j][i - 1];
      if (v == 1) ans |= (1LL << j);
    }
    cout << ans << " ";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed;
  cout << setprecision(10);
  int test_cases = 1;
  for (int i = 1; i <= test_cases; i++) {
    MAIN(i);
  }
}
