#include <bits/stdc++.h>
using namespace std;
int a[100009][30];
int b[100009][30];
int c[30];
void solve() {
  int n, m;
  cin >> n >> m;
  int mark[m][3];
  c[0] = 1;
  for (int i = 0; i < m; i++) {
    cin >> mark[i][0] >> mark[i][1] >> mark[i][2];
    int ele = mark[i][2];
    int ind = 0;
    int x = mark[i][0];
    int y = mark[i][1];
    while (ele) {
      if (ele & 1) {
        a[x][ind] += 1;
        a[y + 1][ind] -= 1;
      }
      ele /= 2;
      ind++;
    }
  }
  for (int j = 1; j < 30; j++) c[j] = 2 * c[j - 1];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 30; j++) {
      a[i][j] += a[i - 1][j];
      if (a[i][j] == 0)
        b[i][j] = b[i - 1][j] + 1;
      else
        b[i][j] = b[i - 1][j];
    }
  }
  for (int i = 0; i < m; i++) {
    int ele = mark[i][2];
    int ind = 0;
    int x = mark[i][0];
    int y = mark[i][1];
    while (ind < 30) {
      if (ele % 2 == 0) {
        if (b[y][ind] - b[x - 1][ind] == 0) {
          cout << "NO";
          return;
        }
      }
      ele /= 2;
      ind++;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    int vl = 0;
    for (int j = 0; j < 30; j++)
      if (a[i][j] > 0) vl += c[j];
    cout << vl << " ";
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
