#include <bits/stdc++.h>
using namespace std;
int gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
string A;
int r[1000001], l[1000001], q[1000001], ans[1000001], a[1000001];
struct node {
  int x;
  void merge(node a, node b) { x = a.x & b.x; }
  node() { x = (1ll << 30) - 1; }
} tree[4 * 1000001];
void build(int root, int s, int e) {
  if (s == e) {
    tree[root].x = a[e];
    return;
  }
  int mid = (s + e) / 2;
  build(root * 2, s, mid);
  build(root * 2 + 1, mid + 1, e);
  tree[root].merge(tree[root * 2], tree[root * 2 + 1]);
}
node query(int root, int l, int r, int i, int j) {
  if (l >= i && r <= j) return tree[root];
  int mid = (l + r) / 2;
  node left = node(), right = node();
  if (i <= mid) left = query(2 * root, l, mid, i, j);
  if (j > mid) right = query(2 * root + 1, mid + 1, r, i, j);
  ;
  node temp = node();
  temp.merge(left, right);
  return temp;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < int(m); i++) {
    cin >> l[i] >> r[i] >> q[i];
    l[i]--;
  }
  memset(a, 0, sizeof(a));
  ;
  for (int i = 0; i < int(32); i++) {
    memset(ans, 0, sizeof(ans));
    ;
    for (int j = 0; j < int(m); j++) {
      if (1 & (q[j] >> i)) {
        ans[l[j]]++;
        ans[r[j]]--;
      }
    }
    for (int j = 0; j < int(n); j++) {
      if (j) ans[j] += ans[j - 1];
      if (ans[j]) a[j] |= (1 << i);
    }
  }
  build(1, 0, n);
  for (int i = 0; i < int(m); i++) {
    int temp = query(1, 0, n, l[i], r[i] - 1).x;
    if (temp != q[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < int(n); i++) {
    cout << a[i] << " ";
  }
  return 0;
}
