#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long a, long long b, long long m = 1000000007) {
  long long answer = 1;
  while (b) {
    if (b & 1) answer = (answer * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return answer;
}
using namespace std;
void ctrl() { cout << "Control" << endl; }
long long make_num(string p) {
  stringstream geek(p);
  long long x = 0;
  geek >> x;
  return x;
}
string make_str(long long x) {
  ostringstream str1;
  str1 << x;
  string geek = str1.str();
  return geek;
}
long long dp[30][100000 + 5];
long long A[100000 + 5];
const long long N = 1e5 + 5;
const long long mx = (1 << 30) - 1;
long long high[4 * N + 10], low[4 * N + 10];
struct Node {
  long long gd;
  Node(long long x) { gd = x; }
  Node() {}
};
struct Node Tree[4 * N + 10];
void init(long long node, long long start, long long end) {
  high[node] = end;
  low[node] = start;
  if (start == end) {
    return;
  }
  long long mid = (start + end) / 2;
  init(2 * node, start, mid);
  init(2 * node + 1, mid + 1, end);
}
struct Node combine(struct Node a, struct Node b) {
  return Node(a.gd & b.gd);
}
void build(long long node, long long start, long long end) {
  if (low[node] == high[node]) {
    Tree[node].gd = A[low[node]];
    return;
  }
  long long mid = (start + end) / 2;
  build(2 * node, start, mid);
  build(2 * node + 1, mid + 1, end);
  Tree[node] = combine(Tree[2 * node], Tree[2 * node + 1]);
}
struct Node query(long long node, long long start, long long end) {
  if (low[node] > end || high[node] < start || start > end)
    return Node{mx};
  else if (start <= low[node] && end >= high[node]) {
    return Tree[node];
  }
  struct Node x = query(2 * node, start, end);
  struct Node y = query(2 * node + 1, start, end);
  struct Node res = combine(x, y);
  return res;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  long long n, m;
  cin >> n >> m;
  vector<pair<pair<long long, long long>, long long>> v;
  for (long long i = 0; i < m; i++) {
    long long l, r, w;
    cin >> l >> r >> w;
    v.push_back({{l, r}, w});
    for (long long j = 0; j < 30; j++) {
      long long x = (1 << j);
      x = x & w;
      if (x) {
        dp[j][l]++;
        dp[j][r + 1]--;
      }
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 30; j++) {
      dp[j][i] += dp[j][i - 1];
      if (dp[j][i]) A[i] += (1 << j);
    }
  }
  init(1, 1, n);
  build(1, 1, n);
  bool flag = true;
  for (long long i = 0; i < m; i++) {
    long long l = v[i].first.first, r = v[i].first.second;
    struct Node second = query(1, l, r);
    if (second.gd != v[i].second) flag = false;
  }
  if (flag) {
    cout << "YES\n";
    for (long long i = 1; i <= n; i++) {
      cout << A[i] << " ";
    }
  } else {
    cout << "NO\n";
  }
  return 0;
}
