#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const long long MOD = 998244353;
const double EPS = 1e-8;
const double PI = acos(-1.0);
template <class T>
class SegmentTree {
 public:
  SegmentTree(std::vector<T> data, T value, T (*combine)(T obj1, T obj2));
  SegmentTree(T ar[], int n, T value, T (*combine)(T obj1, T obj2));
  T query(int l, int r);
  void update(int idx, T val);

 private:
  T *tree;
  void buildTree(std::vector<T> data);
  int segTreeSize;
  T valueForExtraNodes;
  T (*combine)(T obj1, T obj2);
  int calculateSize(int n);
  T queryHelper(int l, int r, int st, int ed, int node);
};
template <class T>
SegmentTree<T>::SegmentTree(std::vector<T> data, T value,
                            T (*combine)(T obj1, T obj2)) {
  this->combine = combine;
  valueForExtraNodes = value;
  segTreeSize = calculateSize(data.size());
  buildTree(data);
}
template <class T>
SegmentTree<T>::SegmentTree(T ar[], int n, T value,
                            T (*combine)(T obj1, T obj2)) {
  this->combine = combine;
  valueForExtraNodes = value;
  segTreeSize = calculateSize(n);
  std::vector<T> data;
  for (int i = 0; i < n; i++) data.push_back(ar[i]);
  buildTree(data);
}
template <class T>
int SegmentTree<T>::calculateSize(int n) {
  int pow2 = 1;
  while (pow2 < n) {
    pow2 = pow2 << 1;
  }
  return 2 * pow2 - 1;
}
template <class T>
T SegmentTree<T>::query(int l, int r) {
  int st = 0, ed = segTreeSize / 2;
  return queryHelper(l, r, st, ed, 0);
}
template <class T>
T SegmentTree<T>::queryHelper(int l, int r, int st, int ed, int node) {
  if ((r < st) || (l > ed) || (l > r)) return valueForExtraNodes;
  if (st >= l && ed <= r) return tree[node];
  T leftVal = queryHelper(l, r, st, (st + ed) / 2, (2 * node + 1));
  T rightVal = queryHelper(l, r, (st + ed) / 2 + 1, ed, (2 * node + 2));
  return combine(leftVal, rightVal);
}
template <class T>
void SegmentTree<T>::buildTree(std::vector<T> data) {
  int n = data.size();
  tree = new T[segTreeSize];
  int extraNodes = (segTreeSize / 2 + 1) - n;
  for (int i = segTreeSize - 1; i >= 0; i--) {
    if (extraNodes > 0) {
      tree[i] = valueForExtraNodes;
      extraNodes--;
    } else if (n > 0) {
      tree[i] = data[n - 1];
      n--;
    } else
      tree[i] = combine(tree[(2 * i + 1)], tree[(2 * i + 2)]);
  }
}
template <class T>
void SegmentTree<T>::update(int idx, T val) {
  int segTreeIdx = (segTreeSize / 2) + idx;
  tree[segTreeIdx] = val;
  while (((segTreeIdx - 1) / 2) >= 0) {
    segTreeIdx = ((segTreeIdx - 1) / 2);
    if ((2 * segTreeIdx + 2) < segTreeSize)
      tree[segTreeIdx] =
          combine(tree[(2 * segTreeIdx + 1)], tree[(2 * segTreeIdx + 2)]);
    if (segTreeIdx == 0) break;
  }
}
const int N = 1e5 + 5;
const int mxbit = 32;
long long ors(long long a, long long b) { return a & b; }
void solve() {
  int n, m;
  cin >> n >> m;
  vector<long long> l(N), r(N), q(N);
  vector<long long> a(N);
  for (int i = 0; i < m; ++i) {
    cin >> l[i] >> r[i] >> q[i];
    l[i]--;
    r[i]--;
  }
  for (int bit = 0; bit < mxbit; ++bit) {
    vector<long long> sums(n + 1);
    for (int i = 0; i < m; ++i) {
      if ((q[i] >> bit) & 1) {
        sums[l[i]]++;
        sums[r[i] + 1]--;
      }
    }
    for (int i = 0; i < n; ++i) {
      if (i - 1 >= 0) sums[i] += sums[i - 1];
      if (sums[i] > 0) {
        a[i] = a[i] | (1 << bit);
      }
    }
  }
  long long mx = 1;
  long long k = 1;
  for (int i = 1; i <= mxbit; ++i) {
    k *= 2;
    mx += (k);
  }
  SegmentTree<long long> sgtree(a, mx, ors);
  for (int i = 0; i < m; ++i) {
    long long p = sgtree.query(l[i], r[i]);
    if (p != q[i]) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) {
    cout << a[i] << " ";
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
