#include <bits/stdc++.h>
using namespace std;
const int B = 31, N = 100012;
int n, m, q, w, y, l[N], r[N], x[N];
int s[N][B + 1], ss[N][B + 1], cur[B + 1], a[N], ll, rr, xx;
int sum(int l, int r, int x) { return ss[r][x] - ss[l - 1][x]; }
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> l[i] >> r[i] >> x[i];
    for (int j = 0; j < B; j++) {
      q = 1 << j;
      w = q & x[i];
      if (w != 0) {
        s[l[i]][j]++;
        s[r[i] + 1][j]--;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < B; j++) {
      cur[j] += s[i][j];
      if (cur[j] != 0) a[i] += 1 << j;
      ss[i][j] = ss[i - 1][j];
      if (cur[j] != 0) ss[i][j]++;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < B; j++) {
      q = 1 << j;
      w = q & x[i];
      if (w == 0) {
        if (sum(l[i], r[i], j) == (r[i] - l[i] + 1)) {
          cout << "NO";
          return 0;
        }
      } else {
        if (sum(l[i], r[i], j) != (r[i] - l[i] + 1)) {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
}
