#include <bits/stdc++.h>
using namespace std;
int cnt[100005][30], inp[100005][3], ans[100005];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  memset(cnt, 0, sizeof(cnt));
  int n, m, i, j, k, a, b;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    for (j = 0; j < 3; j++) cin >> inp[i][j];
  }
  for (i = 0; i < m; i++) {
    a = inp[i][2];
    k = 0;
    while (k < 30) {
      if (a % 2 == 1) {
        cnt[inp[i][0]][k]++;
        cnt[inp[i][1] + 1][k]--;
      }
      a /= 2;
      k++;
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j < 30; j++) cnt[i][j] += cnt[i - 1][j];
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j < 30; j++) cnt[i][j] = min(cnt[i][j], 1);
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j < 30; j++) cnt[i][j] += cnt[i - 1][j];
  }
  for (i = 0; i < m; i++) {
    a = inp[i][2];
    k = 0;
    while (k < 30) {
      if ((a % 2 == 1 && (cnt[inp[i][1]][k] - cnt[inp[i][0] - 1][k]) !=
                             (inp[i][1] - inp[i][0] + 1)) ||
          (a % 2 == 0 && (cnt[inp[i][1]][k] - cnt[inp[i][0] - 1][k]) ==
                             (inp[i][1] - inp[i][0] + 1))) {
        cout << "NO";
        return 0;
      }
      a /= 2;
      k++;
    }
  }
  for (i = 1; i <= n; i++) {
    k = 0;
    b = 0;
    j = 1;
    while (k < 30) {
      if ((cnt[i][k] - cnt[i - 1][k]) == 1) b = b | j;
      k++;
      j *= 2;
    }
    ans[i] = b;
  }
  cout << "YES\n";
  for (i = 1; i <= n; i++) cout << ans[i] << " ";
}
