#include <bits/stdc++.h>
using namespace std;
int n;
int lazy[600005];
bool haslazy[600005];
int tree[600005];
int arr[200005];
int lft(int x) { return 2 * x + 1; }
int ryt(int x) { return 2 * x + 2; }
struct lol {
  int x;
  int y;
  int z;
};
void updt(int x, int l, int r, int value) {
  tree[x] = (value | tree[x]);
  if (haslazy[x])
    lazy[x] = (lazy[x] | value);
  else
    lazy[x] = value;
  haslazy[x] = true;
}
void laze(int x, int l, int r) {
  if (!haslazy[x]) return;
  int mid = (l + r) / 2;
  updt(ryt(x), mid + 1, r, lazy[x]);
  updt(lft(x), l, mid, lazy[x]);
  lazy[x] = 0;
  haslazy[x] = false;
}
void prop(int x, int l, int r, int a, int b, int value) {
  if (r < a || l > b) return;
  if (l >= a && r <= b) {
    updt(x, l, r, value);
    return;
  }
  laze(x, l, r);
  int mid = (l + r) / 2;
  prop(lft(x), l, mid, a, b, value);
  prop(ryt(x), mid + 1, r, a, b, value);
  int ta = tree[lft(x)];
  int tb = tree[ryt(x)];
  tree[x] = (ta & tb);
}
int query(int x, int l, int r, int a, int b) {
  if (l > b || r < a) return ((long long)1 << (long long)31) - 1;
  if (l >= a && r <= b) {
    return tree[x];
  }
  laze(x, l, r);
  int mid = (l + r) / 2;
  int ta = query(lft(x), l, mid, a, b);
  int tb = query(ryt(x), mid + 1, r, a, b);
  return (ta & tb);
}
void build(int x, int a, int b) {
  if (a == b) {
    tree[x] = 0;
    return;
  }
  int mid = (a + b) / 2;
  build(lft(x), a, mid);
  build(ryt(x), mid + 1, b);
  tree[x] = 0;
}
int main() {
  cin >> n;
  build(0, 0, n - 1);
  int m;
  cin >> m;
  vector<lol> q;
  for (int i = 0; i < m; i++) {
    lol temp;
    cin >> temp.x >> temp.y >> temp.z;
    prop(0, 0, n - 1, temp.x - 1, temp.y - 1, temp.z);
    q.push_back(temp);
  }
  bool flag = false;
  for (int i = 0; i < m; i++) {
    if (query(0, 0, n - 1, q[i].x - 1, q[i].y - 1) != q[i].z) {
      flag = true;
      break;
    }
  }
  if (flag) {
    cout << "NO";
  } else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      int temp = query(0, 0, n - 1, i, i);
      cout << temp << " ";
    }
  }
}
