#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> a0, a1;
  set<pair<long long, long long>> s;
  for (long long i = 0; i < m; ++i) {
    long long t, l, r;
    cin >> t >> l >> r;
    if (t) {
      a1.push_back({l - 1, r - 1});
    } else {
      a0.push_back({l - 1, r - 1});
    }
  }
  sort(a1.begin(), a1.end());
  vector<long long> ans(n);
  for (long long i = 0; i < n; ++i) ans[i] = 1000 - i;
  for (long long i = 0; i < a1.size(); ++i) {
    long long l = a1[i].first, r = a1[i].second;
    for (long long j = l; j <= r; ++j) {
      ans[j] = ans[l];
    }
  }
  for (long long i = 0; i < a0.size(); ++i) {
    long long l = a0[i].first, r = a0[i].second;
    bool stop = true;
    for (long long j = l; j <= r; ++j) {
      if (j > l && ans[j] < ans[j - 1]) {
        stop = false;
        break;
      }
    }
    if (stop) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (long long i = 0; i < n; ++i) cout << ans[i] << ' ';
  return 0;
}
