#include <bits/stdc++.h>
using namespace std;
struct Query {
  int l, r, q;
} q[100005], q0[100005], q1[100005];
int a[100005], ev1_l[100005], ev1_r[100005], cont[100005], resp[100005];
pair<int, int> ev0_l[100005], ev0_r[100005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &q[i].l, &q[i].r, &q[i].q);
  }
  bool valid = true;
  for (int k = 0; k < 30; k++) {
    int nq0 = 0, nq1 = 0;
    for (int i = 0; i < m; i++) {
      if (q[i].q & (1 << k))
        q1[nq1].q = 1, q1[nq1].l = q[i].l, q1[nq1].r = q[i].r, nq1++;
      else
        q0[nq0].q = 0, q0[nq0].l = q[i].l, q0[nq0].r = q[i].r, nq0++;
      ;
    }
    memset(a, 0, sizeof(int) * (n + 1));
    for (int i = 0; i < nq1; i++) ev1_l[i] = q1[i].l, ev1_r[i] = q1[i].r;
    sort(ev1_l, ev1_l + nq1);
    sort(ev1_r, ev1_r + nq1);
    int ct = 0, pos1 = 0, pos2 = 0;
    for (int i = 1; i <= n; i++) {
      while (pos1 < nq1 && ev1_l[pos1] == i) pos1++, ct++;
      if (ct > 0) a[i] = 1;
      while (pos2 < nq1 && ev1_r[pos2] == i) pos2++, ct--;
    }
    for (int i = 0; i < nq0; i++)
      ev0_l[i].first = q0[i].l, ev0_l[i].second = i, ev0_r[i].first = q0[i].r,
      ev0_r[i].second = i;
    sort(ev0_l, ev0_l + nq0);
    sort(ev0_r, ev0_r + nq0);
    memset(cont, 0, sizeof(int) * (n + 1));
    pos1 = 0, pos2 = 0, ct = 0;
    for (int i = 1; i <= n; i++) {
      while (pos1 < nq0 && ev0_l[pos1].first == i)
        cont[ev0_l[pos1].second] = ct, pos1++;
      if (a[i] == 0) ct++;
      while (pos2 < nq0 && ev0_r[pos2].first == i)
        cont[ev0_r[pos2].second] = ct - cont[ev0_r[pos2].second], pos2++;
    }
    for (int i = 0; i < nq0; i++)
      if (cont[i] == 0) {
        valid = false;
        break;
      }
    if (!valid) break;
    for (int i = 1; i <= n; i++)
      if (a[i]) resp[i] |= (1 << k);
  }
  if (!valid)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      if (i > 1) cout << " ";
      cout << resp[i];
    }
    cout << endl;
  }
  return 0;
}
