#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
void CI(int &_x) { scanf("%d", &_x); }
void CO(int &_x) { cout << _x; }
template <typename T>
void getarray(T a[], int n) {
  for (int i = 0; i < n; i++) cin >> a[i];
}
template <typename T>
void printarray(T a[], int n) {
  for (int i = 0; i < n - 1; i++) cout << a[i] << " ";
  cout << a[n - 1] << endl;
}
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
int dr8[8] = {1, -1, 0, 0, 1, -1, -1, 1};
int dc8[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dr4[4] = {0, 0, 1, -1};
int dc4[4] = {-1, 1, 0, 0};
int kn8r[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int kn8c[8] = {2, 1, -1, -2, -2, -1, 1, 2};
int ar[100005];
int l[100000 + 5], r[100000 + 5], q[100000 + 5], sum[100000 + 5];
int a[100000 + 5], tree[3 * 100000 + 5];
void init(int node, int b, int e) {
  if (b == e) {
    tree[node] = a[b - 1];
    return;
  }
  int left = node * 2;
  int right = left + 1;
  int mid = (b + e) / 2;
  init(left, b, mid);
  init(right, mid + 1, e);
  tree[node] = tree[left] & tree[right];
}
int query(int node, int b, int e, int x, int y) {
  if (x > e || b > y) return (1 << 30) - 1;
  if (b >= x && e <= y) return tree[node];
  int left = node * 2;
  int right = left + 1;
  int mid = (b + e) / 2;
  int p1 = query(left, b, mid, x, y);
  int p2 = query(right, mid + 1, e, x, y);
  return p1 & p2;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int ll, rr, qq;
    cin >> l[i] >> r[i] >> q[i];
    l[i] -= 1;
  }
  for (int pos = 0; pos <= 30; pos++) {
    memset(sum, 0, sizeof sum);
    for (int i = 0; i < m; i++)
      if (check(q[i], pos)) {
        sum[l[i]]++;
        sum[r[i]]--;
      }
    for (int i = 1; i < n; i++) sum[i] += sum[i - 1];
    for (int i = 0; i < n; i++)
      if (sum[i] > 0) a[i] = Set(a[i], pos);
  }
  init(1, 1, n);
  for (int i = 0; i < m; i++) {
    int ans = query(1, 1, n, l[i] + 1, r[i]);
    if (ans != q[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
