#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int INF = 0x3F3F3F3F;
const int BITS = 30;
struct SegmentTree {
  struct SegNode {
    int l, r;
    int sum;
    inline int Mid() { return (l + r) >> 1; }
  };
  SegNode tree[MAXN << 2];
  void PushUp(int rt) {
    tree[rt].sum = tree[(rt << 1)].sum & tree[(rt << 1 | 1)].sum;
  }
  void Build(int rt, int l, int r, int val[]) {
    tree[rt].l = l, tree[rt].r = r;
    if (l == r) {
      tree[rt].sum = val[l];
      return;
    }
    int mid = (l + r) >> 1;
    Build((rt << 1), l, mid, val);
    Build((rt << 1 | 1), mid + 1, r, val);
    PushUp(rt);
  }
  int Query(int rt, int l, int r) {
    if (l <= tree[rt].l && tree[rt].r <= r) {
      return tree[rt].sum;
    }
    int mid = tree[rt].Mid();
    if (r <= mid) {
      return Query((rt << 1), l, r);
    } else if (mid < l) {
      return Query((rt << 1 | 1), l, r);
    } else {
      return Query((rt << 1), l, mid) & Query((rt << 1 | 1), mid + 1, r);
    }
  }
};
struct LimitNode {
  int l, r, q;
  void read() { cin >> l >> r >> q; }
};
SegmentTree seg;
LimitNode limit[MAXN];
int arr[MAXN];
int tag[MAXN];
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  while (cin >> n >> m) {
    for (int i = 1; i <= m; ++i) {
      limit[i].read();
    }
    fill_n(arr, n + 1, 0);
    for (int i = 0; i <= BITS; ++i) {
      fill_n(tag, n + 1, 0);
      for (int j = 1; j <= m; ++j) {
        if ((1 << i) & limit[j].q) {
          tag[limit[j].l]++;
          tag[limit[j].r + 1]--;
        }
      }
      int sum = 0;
      for (int j = 1; j <= n; ++j) {
        sum += tag[j];
        if (sum) {
          arr[j] |= (1 << i);
        }
      }
    }
    seg.Build(1, 1, n, arr);
    bool ok = true;
    for (int i = 1; i <= m; ++i) {
      if (seg.Query(1, limit[i].l, limit[i].r) != limit[i].q) {
        ok = false;
        break;
      }
    }
    if (ok) {
      puts("YES");
      for (int i = 1; i <= n; ++i) {
        printf("%d%c", arr[i], (i == n) ? '\n' : ' ');
      }
    } else {
      puts("NO");
    }
  }
  return 0;
}
