#include <bits/stdc++.h>
using namespace std;
int con[100000][3];
struct Node {
  int from, to;
  int val;
  Node *left, *right;
  Node(int from, int to) {
    this->from = from;
    this->to = to;
    val = 0;
    left = right = NULL;
  }
};
void insert(Node *node, int l, int r, int q) {
  if (node->from == l && node->to == r) {
    node->val |= q;
    return;
  }
  int mid = (node->from + node->to) / 2;
  if (r <= mid) {
    if (node->left == NULL) node->left = new Node(node->from, mid);
    insert(node->left, l, r, q);
  } else if (l > mid) {
    if (node->right == NULL) node->right = new Node(mid + 1, node->to);
    insert(node->right, l, r, q);
  } else {
    if (node->left == NULL) node->left = new Node(node->from, mid);
    if (node->right == NULL) node->right = new Node(mid + 1, node->to);
    insert(node->left, l, mid, q);
    insert(node->right, mid + 1, r, q);
  }
}
int run(Node *node, int prev) {
  if (node == NULL) return prev;
  node->val |= prev;
  node->val |= run(node->left, node->val) & run(node->right, node->val);
  return node->val;
}
int cal(Node *node, int l, int r) {
  if (l == node->from && r == node->to) return node->val;
  int mid = (node->from + node->to) / 2;
  if (r <= mid) return cal(node->left, l, r);
  if (l > mid) return cal(node->right, l, r);
  return cal(node->left, l, mid) & cal(node->right, mid + 1, r);
}
int get(Node *node, int pos) {
  if (node->from == node->to) return node->val;
  int mid = (node->from + node->to) / 2;
  if (pos <= mid) {
    if (node->left == NULL) return node->val;
    return get(node->left, pos);
  }
  if (node->right == NULL) return node->val;
  return get(node->right, pos);
}
int main() {
  int n, m;
  cin >> n >> m;
  Node root(1, n);
  for (int i = 0; i < m; i++) {
    cin >> con[i][0] >> con[i][1] >> con[i][2];
    insert(&root, con[i][0], con[i][1], con[i][2]);
  }
  run(&root, 0);
  for (int i = 0; i < m; i++)
    if (cal(&root, con[i][0], con[i][1]) != con[i][2]) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << get(&root, i) << " ";
  cout << endl;
  return 0;
}
