#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int kMaxN = 1e5 + 3;
vector<int> in[kMaxN];
vector<int> out[kMaxN];
int q[kMaxN];
struct SegTree {
  int sz;
  static constexpr int kMax = (1 << 30) - 1;
  struct node {
    int v = kMax;
    void merge(node& n1, node& n2) { v = n1.v & n2.v; }
  };
  vector<node> nodes;
  SegTree(vector<int>& a) {
    sz = 1;
    int n = a.size();
    while (sz < n) {
      sz *= 2;
    }
    nodes.resize(2 * sz);
    for (int i = 0; i < n; ++i) {
      nodes[i + sz].v = a[i];
    }
    for (int i = sz - 1; i > 0; --i) {
      nodes[i].merge(nodes[2 * i], nodes[2 * i + 1]);
    }
  }
  int get_and(int l, int r) { return get_and(1, 0, sz - 1, l, r); }

 private:
  int get_and(int idx, int L, int R, int l, int r) {
    if (l > R || r < L) {
      return kMax;
    }
    if (l <= L && R <= r) {
      return nodes[idx].v;
    }
    int M = (L + R) / 2;
    return get_and(2 * idx, L, M, l, r) & get_and(2 * idx + 1, M + 1, R, l, r);
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<array<int, 3>> queries(m);
  for (int i = 0; i < m; ++i) {
    int l, r;
    cin >> l >> r >> q[i];
    --l, --r;
    in[l].emplace_back(i);
    out[r].emplace_back(i);
    queries[i] = {l, r, q[i]};
  }
  array<int, 30> cur{};
  int elem = 0;
  for (int i = 0; i < n; ++i) {
    for (int query : in[i]) {
      for (int k = 0; k < 30; ++k) {
        if (q[query] & (1 << k)) {
          if (cur[k]++ == 0) {
            elem |= 1 << k;
          }
        }
      }
    }
    a[i] = elem;
    for (int query : out[i]) {
      for (int k = 0; k < 30; ++k) {
        if (q[query] & (1 << k)) {
          if (--cur[k] == 0) {
            elem -= 1 << k;
          }
        }
      }
    }
  }
  SegTree st(a);
  for (auto& query : queries) {
    if (st.get_and(query[0], query[1]) != query[2]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int x : a) {
    cout << x << ' ';
  }
  cout << '\n';
  return 0;
}
