#include <bits/stdc++.h>
using namespace std;
vector<long long> tree(3200000), res(3200000, 0);
void build(int start, int end, int node) {
  if (start == end) {
    tree[node] = res[start];
    return;
  }
  int mid = (start + end) / 2;
  build(start, mid, 2 * node);
  build(mid + 1, end, 2 * node + 1);
  tree[node] = (tree[2 * node] & tree[2 * node + 1]);
}
long long query(int l, int r, int start, int end, int node) {
  if (start >= l && end <= r) return tree[node];
  if (r < start || l > end) return INT_MAX;
  int mid = (start + end) / 2;
  return (query(l, r, start, mid, 2 * node) &
          query(l, r, mid + 1, end, 2 * node + 1));
}
int main() {
  int n, m, i, j;
  cin >> n >> m;
  vector<vector<int> > v(n + 1, vector<int>(30));
  vector<vector<int> > q(m, vector<int>(3));
  for (i = 0; i < m; i++) cin >> q[i][0] >> q[i][1] >> q[i][2];
  for (i = 0; i < m; i++) {
    int temp = q[i][2];
    for (j = 0; temp > 0; j++) {
      if (temp & 1) {
        v[q[i][0]][j]++;
        if (q[i][1] != n) v[q[i][1] + 1][j]--;
      }
      temp /= 2;
    }
  }
  vector<int> p(30);
  for (i = 1; i <= n; i++) {
    for (j = 0; j < 30; j++) {
      p[j] += v[i][j];
      if (p[j] > 0) res[i] += pow(2, j);
    }
  }
  build(1, n, 1);
  for (i = 0; i < m; i++) {
    if (q[i][2] != query(q[i][0], q[i][1], 1, n, 1)) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (i = 1; i <= n; i++) cout << res[i] << " ";
}
