#include <bits/stdc++.h>
using namespace std;
struct node {
  int l, r, q;
  node(int _l = 0, int _r = 0, int _q = 0) : l(_l), r(_r), q(_q) {}
  bool operator<(node n) const {
    if (l < n.l)
      return 1;
    else if (l > n.l)
      return 0;
    if (r < n.r)
      return 1;
    else if (r > n.r)
      return 0;
    if (q < n.q) return 1;
    return 0;
  }
  void print() { printf("%d %d %d\n", l, r, q); }
};
const int N = 100500;
bool comp(node a, node b) {
  if (a.r < b.r)
    return 1;
  else if (a.r > b.r)
    return 0;
  if (a.l < b.l)
    return 1;
  else if (a.l > b.l)
    return 0;
  if (a.q < b.q) return 1;
  return 0;
}
int a[N][30], ans[N];
node c[N], c1[N];
int d[30];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int l, r, q;
    scanf("%d %d %d", &l, &r, &q);
    c1[i] = c[i] = node(l - 1, r - 1, q);
  }
  sort(c, c + m);
  sort(c1, c1 + m, comp);
  for (int i = 0, j = 0, k = 0; i < n; ++i) {
    while (j < m && c[j].l <= i) {
      for (int h = 0; h < 30; ++h) {
        d[h] += ((c[j].q & (1 << h)) != 0 ? 1 : 0);
      }
      ++j;
    }
    for (int h = 0; h < 30; ++h) {
      a[i][h] = (d[h] == 0 ? 0 : 1);
      ans[i] += ((d[h] == 0 ? 0 : 1) << h);
    }
    while (k < m && c1[k].r <= i) {
      for (int h = 0; h < 30; ++h) {
        d[h] -= ((c1[k].q & (1 << h)) != 0 ? 1 : 0);
      }
      ++k;
    }
    if (i > 0) {
      for (int h = 0; h < 30; ++h) {
        a[i][h] += a[i - 1][h];
      }
    }
  }
  for (int i = 0; i < m; ++i) {
    node g = c[i];
    for (int h = 0; h < 30; ++h) {
      d[h] = a[g.r][h] - (g.l > 0 ? a[g.l - 1][h] : 0);
      if (d[h] > g.r - g.l && (g.q & (1 << h)) == 0) {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    printf("%d ", ans[i]);
  }
  cout << endl;
  return 0;
}
