#include <bits/stdc++.h>
using namespace std;
const int NMAX = 1e5;
const int LOG = 30;
int v[LOG + 1][NMAX + 2];
int xx[NMAX + 2], yy[NMAX + 2], qq[NMAX + 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N, Q;
  cin >> N >> Q;
  for (int i = 1; i <= Q; ++i) {
    int x, y, val;
    cin >> x >> y >> val;
    xx[i] = x;
    yy[i] = y;
    qq[i] = val;
    for (int j = 0; j <= LOG; ++j) {
      if (val & (1 << j)) {
        v[j][x]++;
        v[j][y + 1]--;
      }
    }
  }
  for (int j = 0; j <= LOG; ++j)
    for (int i = 1; i <= NMAX; ++i) v[j][i] += v[j][i - 1];
  for (int j = 0; j <= LOG; ++j) {
    for (int i = 1; i <= NMAX; ++i) {
      if (v[j][i])
        v[j][i] = 1;
      else
        v[j][i] = 0;
      v[j][i] += v[j][i - 1];
    }
  }
  for (int i = 1; i <= Q; ++i) {
    int x = xx[i];
    int y = yy[i];
    int val = qq[i];
    int actual = 0;
    for (int j = 0; j <= LOG; ++j) {
      if (v[j][y] - v[j][x - 1] == (y - x + 1)) actual += (1 << j);
    }
    if (actual != val) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= N; ++i) {
    int val = 0;
    for (int j = 0; j <= LOG; ++j) {
      if (v[j][i] - v[j][i - 1] > 0) val += (1 << j);
    }
    cout << val << " \n"[i == N];
  }
  return 0;
}
