#include <bits/stdc++.h>
using namespace std;
void make_unique(vector<int> &a) {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
}
void printDouble(double f, int p) {
  cout << fixed;
  cout << setprecision(p) << f << endl;
}
int Set(int N, int cur) { return N = N | (1 << cur); }
int Reset(int N, int cur) { return N = N & ~(1 << cur); }
bool Check(int N, int cur) { return (bool)(N & (1 << cur)); }
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
long long POW(long long a, long long p) {
  long long res = 1, x = a;
  while (p) {
    if (p & 1) res = (res * x);
    x = (x * x);
    p >>= 1;
  }
  return res;
}
struct qry {
  int u;
  int v;
  int q;
};
int N, M;
int cnt[33][100005];
qry Q[100005];
int A[100005];
int tree[100005 * 4];
void build_tree(int cur, int Start, int End) {
  if (Start == End) {
    tree[cur] = A[Start];
    return;
  }
  int left = cur * 2;
  int right = left + 1;
  int mid = (Start + End) / 2;
  build_tree(left, Start, mid);
  build_tree(right, mid + 1, End);
  tree[cur] = (tree[left] & tree[right]);
}
int tree_query(int cur, int Start, int End, int u, int v) {
  if (End < u || Start > v) {
    return -1;
  }
  if (Start >= u && End <= v) {
    return tree[cur];
  }
  int left = cur * 2;
  int right = left + 1;
  int mid = (Start + End) / 2;
  int v1 = tree_query(left, Start, mid, u, v);
  int v2 = tree_query(right, mid + 1, End, u, v);
  if (v1 == -1) return v2;
  if (v2 == -1) return v1;
  return (v1 & v2);
}
bool solve() {
  for (int pos = 0; pos < 31; pos++) {
    int sum = 0;
    for (int val = 1; val <= N; val++) {
      sum += cnt[pos][val];
      if (sum > 0) {
        cnt[pos][val] = 1;
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    int val = 0;
    for (int pos = 0; pos < 31; pos++) {
      if (cnt[pos][i] == 1) {
        val = Set(val, pos);
      }
    }
    A[i] = val;
  }
  memset(tree, 0, sizeof(tree));
  build_tree(1, 1, N);
  for (int i = 0; i < M; i++) {
    int res = tree_query(1, 1, N, Q[i].u, Q[i].v);
    if (res != Q[i].q) return false;
  }
  return true;
}
int main() {
  memset(cnt, 0, sizeof(cnt));
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    scanf("%d %d %d", &Q[i].u, &Q[i].v, &Q[i].q);
    for (int pos = 0; pos < 31; pos++) {
      if (Check(Q[i].q, pos) == true) {
        cnt[pos][Q[i].u] += 1;
        cnt[pos][Q[i].v + 1] -= 1;
      }
    }
  }
  bool rs = solve();
  if (rs == false) {
    printf("NO\n");
  } else {
    printf("YES\n");
    for (int i = 1; i <= N; i++) {
      if (i == 1)
        printf("%d", A[i]);
      else
        printf(" %d", A[i]);
    }
    printf("\n");
  }
}
