#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3fll;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
const int N = 100010;
int tr[4 * N], lazy[4 * N], v[N], n, m;
void push(int node, int b, int e) {
  tr[node] |= lazy[node];
  if (b != e) {
    lazy[2 * node] |= lazy[node];
    lazy[2 * node + 1] |= lazy[node];
  }
  lazy[node] = 0;
}
void update(int node, int b, int e, int i, int j, int val) {
  push(node, b, e);
  if (i > e or j < b) return;
  if (i <= b and j >= e) {
    lazy[node] |= val;
    push(node, b, e);
    return;
  }
  update(2 * node, b, (b + e) / 2, i, j, val);
  update(2 * node + 1, (b + e) / 2 + 1, e, i, j, val);
}
void build(int node, int b, int e) {
  push(node, b, e);
  if (b == e) {
    v[b] = tr[node];
    return;
  }
  build(2 * node, b, (b + e) / 2);
  build(2 * node + 1, (b + e) / 2 + 1, e);
  tr[node] = tr[2 * node] & tr[2 * node + 1];
}
int query(int node, int b, int e, int i, int j) {
  if (i > e or j < b) return -1;
  if (i <= b and j >= e) return tr[node];
  int p1 = query(2 * node, b, (b + e) / 2, i, j);
  int p2 = query(2 * node + 1, (b + e) / 2 + 1, e, i, j);
  if (p1 == -1) return p2;
  if (p2 == -1) return p1;
  return p1 & p2;
}
int main() {
  scanf("%d%d", &n, &m);
  vector<pair<pair<int, int>, int> > v2;
  for (int i = 0; i < m; i++) {
    int x, y, w;
    scanf("%d%d%d", &x, &y, &w);
    v2.push_back(make_pair(make_pair(x, y), w));
    update(1, 1, n, x, y, w);
  }
  build(1, 1, n);
  for (int i = 0; i < v2.size(); i++) {
    int x = v2[i].first.first;
    int y = v2[i].first.second;
    int w = v2[i].second;
    if (query(1, 1, n, x, y) != w) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << v[i] << " ";
  cout << endl;
  return 0;
}
