#include <bits/stdc++.h>
using namespace std;
int a[100005][31] = {0};
int L[100001];
int R[100001];
int Q[100001];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int z = 0; z < m; z++) {
    int l, r, q;
    scanf("%d %d %d", &l, &r, &q);
    L[z] = l;
    R[z] = r;
    Q[z] = q;
    for (int i = 0; i < 31; i++) {
      if (q & (1 << i)) {
        a[l][i]++;
        a[r + 1][i]--;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 31; j++) {
      a[i][j] += a[i - 1][j];
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 31; j++) {
      if (a[i][j]) a[i][j] = 1;
      if (i) a[i][j] += a[i - 1][j];
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < 31; j++) {
      if ((Q[i] & (1 << j)) == 0) {
        if (a[R[i]][j] - a[L[i] - 1][j] == R[i] - L[i] + 1) {
          cout << "NO" << endl;
          return 0;
        }
      }
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    int num = 0;
    for (int j = 0; j < 31; j++) {
      int val = a[i][j] - a[i - 1][j];
      if (val) num |= (1 << j);
    }
    printf("%d ", num);
  }
  printf("\n");
}
