#include <bits/stdc++.h>
using namespace std;
class Node {
 public:
  int left;
  int right;
  int value;
};
class segTree {
 public:
  Node *tree;
  int length;
  segTree(int length) {
    this->length = length;
    tree = new Node[length * 4];
    createTree(0, 0, length - 1);
  }
  void createTree(int root, int left, int right);
  void setBits(int root, int left, int right, int bits, int parientValue);
  int querybit(int root, int left, int right);
  int queryValue(int root, int index);
};
void segTree::createTree(int root, int left, int right) {
  tree[root].left = left;
  tree[root].right = right;
  tree[root].value = 0;
  if (left == right) {
    return;
  } else {
    int mid = (left + right) / 2;
    createTree(root * 2 + 1, left, mid);
    createTree(root * 2 + 2, mid + 1, right);
    return;
  }
}
void segTree::setBits(int root, int left, int right, int bits,
                      int parientValue) {
  tree[root].value |= parientValue;
  if (left <= tree[root].left && right >= tree[root].right) {
    tree[root].value |= bits;
    return;
  }
  if (left > tree[root].right || right < tree[root].left) return;
  setBits(root * 2 + 1, left, right, bits, tree[root].value);
  setBits(root * 2 + 2, left, right, bits, tree[root].value);
  tree[root].value = tree[root * 2 + 1].value & tree[root * 2 + 2].value;
}
int segTree::querybit(int root, int left, int right) {
  if (left <= tree[root].left && right >= tree[root].right) {
    return tree[root].value;
  }
  if (left > tree[root].right || right < tree[root].left) {
    return 0x7FFFFFFF;
  } else {
    return querybit(root * 2 + 1, left, right) &
           querybit(root * 2 + 2, left, right);
  }
}
int segTree::queryValue(int root, int index) {
  if (index < tree[root].left || index > tree[root].right) {
    return 0;
  }
  if (tree[root].left == tree[root].right) {
    return tree[root].value;
  }
  return tree[root].value | queryValue(root * 2 + 1, index) |
         queryValue(root * 2 + 2, index);
}
int main(void) {
  int n, m;
  int *l, *r, *q;
  cin >> n >> m;
  l = new int[m];
  r = new int[m];
  q = new int[m];
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    l[i]--;
    r[i]--;
  }
  segTree T(n);
  for (int i = 0; i < m; i++) {
    T.setBits(0, l[i], r[i], q[i], 0);
  }
  for (int i = 0; i < m; i++) {
    if (T.querybit(0, l[i], r[i]) != q[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << T.queryValue(0, i) << " ";
  cout << endl;
  return 0;
}
