#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010 * 4;
const int MAXM = 100010 * 8;
const int INF = 1e9 + 7;
const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;
inline int read(int &x) {
  scanf("%d", &x);
  return x;
}
inline long long read(long long &x) {
  scanf("%I64d", &x);
  return x;
}
inline char read(char c) {
  c = getchar();
  return c;
}
inline char *read(char *&x) {
  scanf("%s", x);
  return x;
}
inline char *readln(char *&x) {
  gets(x);
  return x;
}
inline string read(string &x) {
  cin >> x;
  return x;
}
inline string readln(string &x) {
  getline(cin, x);
  return x;
}
inline float read(float &x) {
  scanf("%f", &x);
  return x;
}
inline double read(double &x) {
  scanf("%lf", &x);
  return x;
}
inline void ToString(char *x, string &y) { y = x; }
template <typename T>
inline void read(vector<T> &a, int n) {
  a.clear();
  T x;
  for (int i = 0; i < n; i++) a.push_back(read(x));
}
template <typename T>
inline void read(T a[], int n) {
  for (int i = 0; i < n; i++) read(a[i]);
}
inline int write(int x) {
  printf("%d", x);
  return x;
}
inline int writeln(int x) {
  printf("%d\n", x);
  return x;
}
inline long long write(long long x) {
  printf("%I64d", x);
  return x;
}
inline long long writeln(long long x) {
  printf("%I64d\n", x);
  return x;
}
inline char write(char c) {
  putchar(c);
  return c;
}
inline char writeln(char c) {
  putchar(c);
  putchar('\n');
  return c;
}
inline char *write(char *x) {
  printf("%s", x);
  return x;
}
inline char *writeln(char *x) {
  puts(x);
  return x;
}
inline string write(string x) {
  cout << x;
  return x;
}
inline string writeln(string x) {
  cout << x << '\n';
  return x;
}
inline float write(float x) {
  printf("%f", x);
  return x;
}
inline float writeln(float x) {
  printf("%f\n", x);
  return x;
}
inline double write(double x) {
  printf("%lf", x);
  return x;
}
inline double writeln(double x) {
  printf("%lf\n", x);
  return x;
}
template <typename T>
inline void write(vector<T> &a, int n) {
  for (int i = 0; i < n - 1; i++) {
    write(a[i]);
    putchar(' ');
  }
  writeln(a[n - 1]);
}
template <typename T>
inline void writeln(vector<T> &a, int n) {
  for (int i = 0; i < n; i++) writeln(a[i]);
}
template <typename T>
inline void write(T a[], int n) {
  for (int i = 0; i < n - 1; i++) {
    write(a[i]);
    putchar(' ');
  }
  writeln(a[n - 1]);
}
template <typename T>
inline void writeln(T a[], int n) {
  for (int i = 0; i < n; i++) writeln(a[i]);
}
template <class T>
inline T abs1(T a) {
  return a < 0 ? -a : a;
}
template <class T>
inline T max1(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T max1(T a, T b, T c) {
  return max1(max1(a, b), c);
}
template <class T>
inline T max1(T a, T b, T c, T d) {
  return max1(max1(a, b, c), d);
}
template <class T>
inline T max1(T a, T b, T c, T d, T e) {
  return max1(max1(a, b, c, d), e);
}
template <class T>
inline T min1(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T min1(T a, T b, T c) {
  return min1(min1(a, b), c);
}
template <class T>
inline T min1(T a, T b, T c, T d) {
  return min1(min1(a, b, c), d);
}
template <class T>
inline T min1(T a, T b, T c, T d, T e) {
  return min1(min1(a, b, c, d), e);
}
inline int jud(double a, double b) {
  if (abs(a) < eps && abs(b) < eps)
    return 0;
  else if (abs1(a - b) / abs1(a) < eps)
    return 0;
  if (a < b) return -1;
  return 1;
}
template <typename t>
inline int jud(t a, t b) {
  if (a < b) return -1;
  if (a == b) return 0;
  return 1;
}
struct segtree {
  int l[MAXN];
  int r[MAXN];
  int lson[MAXN];
  int rson[MAXN];
  int state[MAXN];
  int ans[MAXN / 4];
  int root, node;
  void build(int now, int left, int right) {
    l[now] = left;
    r[now] = right;
    if (left < right) {
      int mid = (left + right) >> 1;
      lson[now] = ++node;
      build(node, left, mid);
      rson[now] = ++node;
      build(node, mid + 1, right);
    }
  }
  void buildtree(int left, int right) {
    memset(state, 0, sizeof(state));
    root = 0;
    node = 0;
    build(root, left, right);
  }
  void modify(int now, int left, int right, int q) {
    if ((state[now] | q) == state[now]) return;
    if (l[now] == left && r[now] == right) {
      state[now] |= q;
      return;
    }
    state[lson[now]] |= state[now];
    state[rson[now]] |= state[now];
    int mid = (l[now] + r[now]) >> 1;
    if (left <= mid) {
      modify(lson[now], left, min(mid, right), q);
    }
    if (right > mid) {
      modify(rson[now], max(left, mid + 1), right, q);
    }
    state[now] = (state[lson[now]] & state[rson[now]]);
  }
  bool query(int now, int left, int right, int q) {
    if (state[now] & q) return false;
    if (l[now] == left && r[now] == right) {
      return true;
    }
    int mid = (l[now] + r[now]) >> 1;
    bool res = false;
    state[lson[now]] |= state[now];
    state[rson[now]] |= state[now];
    if (left <= mid) {
      res = res || query(lson[now], left, min(mid, right), q);
    }
    if (right > mid) {
      res = res || query(rson[now], max(left, mid + 1), right, q);
    }
    return res;
  }
  void down(int now) {
    if (l[now] == r[now]) {
      ans[l[now]] = state[now];
      return;
    }
    state[lson[now]] |= state[now];
    state[rson[now]] |= state[now];
    down(lson[now]);
    down(rson[now]);
  }
} seg;
int N, M;
int q[MAXN / 4], l[MAXN / 4], r[MAXN / 4];
int con[33];
int ans[MAXN / 4];
int main() {
  read(N);
  read(M);
  for (int i = 0; i < 31; i++) con[i] = (1 << i);
  seg.buildtree(1, N);
  for (int i = 0; i < M; i++) {
    read(l[i]);
    read(r[i]);
    read(q[i]);
    seg.modify(0, l[i], r[i], q[i]);
  }
  memset(ans, 0, sizeof(ans));
  for (int i = 0; i < M; i++) {
    q[i] = ~q[i];
    for (int j = 0; j < 31; j++)
      if (q[i] & con[j])
        if (!seg.query(0, l[i], r[i], con[j])) {
          puts("NO");
          return 0;
        }
  }
  seg.down(0);
  puts("YES");
  write(seg.ans + 1, N);
  return 0;
}
