#include <bits/stdc++.h>
using namespace std;
long long int g;
long long int l[100005], r[100005], q[100005];
long long int pos[32][100005];
long long int aa[100005], tree[400400];
vector<int> convert(long long g) {
  vector<int> v;
  while (g) {
    v.push_back(g % 2);
    g = g / 2;
  }
  for (int i = v.size(); i < 31; i++) {
    v.push_back(0);
  }
  return v;
}
void build(int cur, int start, int end1) {
  if (start == end1) {
    tree[cur] = aa[start];
    return;
  }
  long long int mid = (start + end1) / 2;
  build(2 * cur, start, mid);
  build(2 * cur + 1, mid + 1, end1);
  tree[cur] = tree[2 * cur] & tree[2 * cur + 1];
}
long long query(int cur, int start, int end1, int x, int y, int i) {
  if (start > y || end1 < x) {
    return g;
  }
  if (x <= start && end1 <= y) {
    return tree[cur];
  }
  long long int mid = (start + end1) / 2;
  long long mm = query(2 * cur, start, mid, x, y, i);
  long long nn = query(2 * cur + 1, mid + 1, end1, x, y, i);
  return (mm & nn);
}
int main() {
  long long power[31];
  power[0] = 1;
  for (int i = 1; i < 31; i++) {
    power[i] = 2 * power[i - 1];
  }
  long long h;
  g = 2;
  for (int i = 2; i <= 31; i++) {
    g = g * 2;
  }
  g--;
  h = g;
  long long int n, m;
  cin >> n >> m;
  int i, j, k;
  vector<int> v;
  for (i = 1; i <= m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    v = convert(q[i]);
    for (j = 0; j < 31; j++) {
      if (v[j]) {
        pos[j][l[i]]++;
        pos[j][r[i] + 1]--;
      }
    }
  }
  for (j = 0; j < 31; j++) {
    pos[j][0] = 0;
    for (k = 1; k <= n; k++) {
      pos[j][k] += pos[j][k - 1];
    }
  }
  for (i = 1; i <= n; i++) {
    long long ans = 0;
    for (j = 0; j < 31; j++) {
      if (pos[j][i] > 0) {
        ans += power[j];
      }
    }
    aa[i] = ans;
  }
  build(1, 1, n);
  for (i = 1; i <= m; i++) {
    if (query(1, 1, n, l[i], r[i], i) != q[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (i = 1; i <= n; i++) {
    cout << aa[i] << " ";
  }
}
