#include <bits/stdc++.h>
using namespace std;
long long getMid(long long start, long long end) {
  return start + (end - start) / 2;
}
long long getFin_helper(vector<long long> &seg_tree, long long index,
                        long long val) {
  if (2 * index + 1 < seg_tree.size() && 2 * index + 2 < seg_tree.size()) {
    seg_tree[index] =
        getFin_helper(seg_tree, 2 * index + 1, val | seg_tree[index]) &
        getFin_helper(seg_tree, 2 * index + 2, val | seg_tree[index]);
  } else {
    seg_tree[index] |= val;
  }
  return seg_tree[index];
}
void updateValue_helper(vector<long long> &seg_tree, long long segment_start,
                        long long segment_end, long long query_start,
                        long long query_end, long long diff, long long index) {
  if (query_start <= segment_start && query_end >= segment_end) {
    seg_tree[index] |= diff;
    return;
  }
  if (segment_end < query_start || segment_start > query_end) return;
  long long mid = getMid(segment_start, segment_end);
  if (query_end <= mid) {
    updateValue_helper(seg_tree, segment_start, mid, query_start, query_end,
                       diff, 2 * index + 1);
  } else if (query_start > mid) {
    updateValue_helper(seg_tree, mid + 1, segment_end, query_start, query_end,
                       diff, 2 * index + 2);
  } else {
    updateValue_helper(seg_tree, segment_start, mid, query_start, mid, diff,
                       2 * index + 1);
    updateValue_helper(seg_tree, mid + 1, segment_end, mid + 1, query_end, diff,
                       2 * index + 2);
  }
}
long long getAnd_helper(vector<long long> &seg_tree, long long segment_start,
                        long long segment_end, long long query_start,
                        long long query_end, long long index) {
  if (query_start <= segment_start && query_end >= segment_end) {
    return seg_tree[index];
  }
  if (segment_end < query_start || segment_start > query_end) return 0;
  long long mid = getMid(segment_start, segment_end);
  if (query_end <= mid) {
    return getAnd_helper(seg_tree, segment_start, mid, query_start, query_end,
                         2 * index + 1);
  } else if (query_start > mid) {
    return getAnd_helper(seg_tree, mid + 1, segment_end, query_start, query_end,
                         2 * index + 2);
  } else {
    return getAnd_helper(seg_tree, segment_start, mid, query_start, mid,
                         2 * index + 1) &
           getAnd_helper(seg_tree, mid + 1, segment_end, mid + 1, query_end,
                         2 * index + 2);
  }
}
void updateValue(vector<long long> &seg_tree, long long query_start,
                 long long query_end, long long diff) {
  long long l = seg_tree.size();
  updateValue_helper(seg_tree, 0, l / 2, query_start, query_end, diff, 0);
}
long long getFin(vector<long long> &seg_tree) {
  long long l = seg_tree.size();
  return getFin_helper(seg_tree, 0, 0);
}
long long getAnd(vector<long long> &seg_tree, long long query_start,
                 long long query_end) {
  long long l = seg_tree.size();
  return getAnd_helper(seg_tree, 0, l / 2, query_start, query_end, 0);
}
long long make_seg_tree(long long n) {
  long long x = (long long)(ceil(log2(n)));
  long long max_size = 2 * (long long)pow(2, x) - 1;
  return max_size;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> seg_tree(make_seg_tree(n));
  int m;
  cin >> m;
  vector<long long> query_p;
  vector<long long> query_q;
  vector<long long> query_v;
  for (int i = 0; i < m; i++) {
    long long p, q, v;
    cin >> p >> q >> v;
    query_p.push_back(p);
    query_q.push_back(q);
    query_v.push_back(v);
    updateValue(seg_tree, p - 1, q - 1, v);
  }
  getFin(seg_tree);
  for (int i = 0; i < m; i++) {
    if (getAnd(seg_tree, query_p[i] - 1, query_q[i] - 1) != query_v[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << seg_tree[seg_tree.size() / 2 + i] << " ";
  }
  return 0;
}
