#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int L[N], R[N], q[N], v[N], add[35][N], tree[4 * N];
void update(int node, int l, int r, int pos, int val) {
  if (l == r)
    tree[node] = val;
  else {
    int m = (l + r) / 2;
    if (pos <= m)
      update(2 * node, l, m, pos, val);
    else
      update(2 * node + 1, m + 1, r, pos, val);
    tree[node] = tree[2 * node] & tree[2 * node + 1];
  }
}
int sum(int node, int l, int r, int x, int y) {
  if (x <= l && r <= y) return tree[node];
  int val = -1, m = (l + r) / 2;
  if (x <= m) val = sum(2 * node, l, m, x, y);
  if (y > m) {
    if (val == -1)
      val = sum(2 * node + 1, m + 1, r, x, y);
    else
      val &= sum(2 * node + 1, m + 1, r, x, y);
  }
  return val;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> L[i] >> R[i] >> q[i];
    for (int j = 0; j < 30; j++)
      if (((1 << j) & q[i])) add[j][L[i]]++, add[j][R[i] + 1]--;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 30; j++) {
      add[j][i] += add[j][i - 1];
      if (add[j][i] > 0) v[i] |= (1 << j);
    }
    update(1, 1, n, i, v[i]);
  }
  bool ok = 1;
  for (int i = 1; i <= m; i++)
    if (sum(1, 1, n, L[i], R[i]) != q[i]) {
      ok = 0;
      break;
    }
  if (!ok)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) cout << v[i] << " ";
  }
}
