#include <bits/stdc++.h>
using namespace std;
int n, m, q[31][100100], pa[31][100100], ar[100100];
vector<int> v1[31][100100];
int main() {
  if (fopen("input.in", "r")) freopen("input.in", "r", stdin);
  cin >> n >> m;
  for (int a, b, c, i = 0; i < m; i++) {
    cin >> a >> b >> c;
    for (int j = 0; j < 31; j++) {
      if ((c >> j) & 1) {
        q[j][a]++;
        q[j][b + 1]--;
      } else
        v1[j][a].push_back(b);
    }
  }
  for (int i = 0; i < 31; i++) {
    int curr = 0;
    for (int j = 1; j <= n; j++) {
      curr += q[i][j];
      if (curr)
        pa[i][j] = 1 + pa[i][j - 1];
      else
        pa[i][j] = pa[i][j - 1];
    }
  }
  for (int i = 0; i < 31; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 0; k != v1[i][j].size(); k++)
        if (v1[i][j][k] - j + 1 == pa[i][v1[i][j][k]] - pa[i][j - 1]) {
          cout << "NO";
          return 0;
        }
      if (pa[i][j] - pa[i][j - 1]) ar[j] |= (1 << i);
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << ar[i] << " ";
  return 0;
}
