#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dx[8] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
const long long inf = 998244353;
vector<int> adj[200010], vis(200010, 0), par(200010, 0), dis(200010, 0),
    di(200010, 0), fin(200010, 0);
int myrandom(int i) { return std::rand() % i; }
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> bit(32, vector<int>(n + 2, 0));
  vector<vector<int>> limits;
  while (m--) {
    int l, r, q;
    cin >> l >> r >> q;
    limits.push_back({l, r, q});
    for (int i = 0; i <= 30; i++) {
      if ((1ll << i) & q) {
        bit[i][l]++;
        bit[i][r + 1]--;
      }
    }
  }
  vector<int> pos[32];
  for (int i = 0; i <= 30; i++) {
    for (int j = 1; j <= n; j++) {
      bit[i][j] += bit[i][j - 1];
      if (bit[i][j] == 0) {
        pos[i].push_back(j);
      }
    }
  }
  bool ok = true;
  for (auto i : limits) {
    int l = i[0], r = i[1], q = i[2];
    for (int i = 0; i <= 30; i++) {
      if ((1ll << i) & q) {
        auto itr = lower_bound((pos[i]).begin(), (pos[i]).end(), l);
        if (itr != pos[i].end() && *itr <= r) {
          ok = false;
          break;
        }
      } else {
        auto itr = lower_bound((pos[i]).begin(), (pos[i]).end(), l);
        if (itr == pos[i].end()) {
          ok = false;
        } else {
          if (*itr > r) {
            ok = false;
          }
        }
      }
    }
    if (!ok) {
      break;
    }
  }
  if (!ok) {
    cout << "NO" << '\n';
  } else {
    cout << "YES" << '\n';
    vector<long long> ans;
    for (int i = 1; i <= n; i++) {
      long long num = 0;
      long long pow = 1;
      for (int j = 0; j <= 30; j++) {
        if (bit[j][i] > 0) {
          num = num + pow;
        }
        pow = pow * 2;
      }
      ans.push_back(num);
    }
    for (auto i : ans) cout << i << " ";
    cout << '\n';
  }
}
