#include <bits/stdc++.h>
using namespace std;
const char InFile[] = "input.in";
const char OutFile[] = "output.out";
const int MaxN = 100111;
int N, M;
int T[32][MaxN], L[MaxN], R[MaxN], Q[MaxN];
int main() {
  cin >> N >> M;
  for (int i = 1; i <= M; ++i) {
    cin >> L[i] >> R[i] >> Q[i];
    int X = Q[i];
    for (int b = 0; b <= 30; ++b, X >>= 1) {
      if (X & 1) {
        T[b][L[i]] += 1;
        T[b][R[i] + 1] -= 1;
      }
    }
  }
  for (int b = 0; b <= 30; ++b) {
    int cnt = 0;
    bool bitSet = false;
    for (int i = 1; i <= N; ++i) {
      cnt += T[b][i];
      if (cnt > 0) {
        bitSet = true;
      } else {
        bitSet = false;
      }
      if (bitSet) {
        T[b][i] = 1;
      } else {
        T[b][i] = 0;
      }
      T[b][i] += T[b][i - 1];
    }
  }
  for (int i = 1; i <= M; ++i) {
    int X = Q[i];
    for (int b = 0; b <= 30; ++b, X >>= 1) {
      if (X & 1) {
        continue;
      }
      if (T[b][R[i]] - T[b][L[i] - 1] == R[i] - L[i] + 1) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= N; ++i) {
    int val = 0;
    for (int b = 30; b >= 0; --b) {
      val <<= 1;
      val += T[b][i] - T[b][i - 1];
    }
    cout << val << " ";
  }
  return 0;
}
