#include <bits/stdc++.h>
using namespace std;
int queries[100005][3];
vector<pair<int, int> > ones;
vector<pair<int, int> > zeros;
int arr[100005];
int tree[2000000];
int lazy[2000000];
void init(int node, int l, int r) {
  lazy[node] = 0;
  tree[node] = 0;
  if (l != r) {
    int mid = (l + r) / 2;
    init(2 * node + 1, l, mid);
    init(2 * node + 2, mid + 1, r);
  }
}
void lazy_update(int node, int l, int r) {
  if (!lazy[node]) {
    return;
  }
  tree[node] = tree[node] | lazy[node];
  if (l != r) {
    lazy[2 * node + 1] |= lazy[node];
    lazy[2 * node + 2] |= lazy[node];
  }
  lazy[node] = 0;
  return;
}
void update(int node, int l, int r, int a, int b, int val) {
  lazy_update(node, l, r);
  if (a > r || b < l) {
    return;
  }
  if (a <= l && b >= r) {
    lazy[node] |= val;
    lazy_update(node, l, r);
    return;
  }
  int mid = (l + r) / 2;
  update(2 * node + 1, l, mid, a, b, val);
  update(2 * node + 2, mid + 1, r, a, b, val);
  tree[node] = tree[2 * node + 1] & tree[2 * node + 2];
}
int query(int node, int l, int r, int a, int b) {
  lazy_update(node, l, r);
  if (a > r || b < l) {
    return (1 << 30) - 1;
  }
  if (a <= l && b >= r) {
    return tree[node];
  }
  int mid = (l + r) / 2;
  return query(2 * node + 1, l, mid, a, b) &
         query(2 * node + 2, mid + 1, r, a, b);
}
void print(int node, int l, int r) {
  lazy_update(node, l, r);
  cout << l << " " << r << ": " << tree[node] << endl;
  ;
  if (l != r) {
    int mid = (l + r) / 2;
    print(2 * node + 1, l, mid);
    print(2 * node + 2, mid + 1, r);
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &queries[i][0], &queries[i][1], &queries[i][2]);
  }
  init(0, 1, n);
  for (int i = 0; i < m; i++) {
    int a = queries[i][0];
    int b = queries[i][1];
    int c = queries[i][2];
    update(0, 1, n, a, b, c);
  }
  for (int i = 0; i < m; i++) {
    int a = queries[i][0];
    int b = queries[i][1];
    int c = queries[i][2];
    if (c != query(0, 1, n, a, b)) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    arr[i] = query(0, 1, n, i, i);
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    cout << arr[i] << " ";
  }
}
