#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool t;
  int l, r;
  vector<pair<int, int>> inc, dec;
  for (int i = 0; i < m; i++) {
    cin >> t >> l >> r;
    if (t)
      inc.push_back({--l, --r});
    else
      dec.push_back({--l, --r});
  }
  vector<int> a(n);
  for (int i = 0; i < n; i++) a[i] = n - i;
  sort(inc.begin(), inc.end());
  sort(dec.begin(), dec.end());
  for (auto el : inc) {
    int j = a[el.first];
    for (int i = el.first; i <= el.second; i++) a[i] = j++;
  }
  for (auto el : dec) {
    bool flag = false;
    for (int i = el.first + 1; i <= el.second; i++)
      flag = flag || a[i - 1] > a[i];
    if (!flag) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (auto el : a) cout << el << " ";
  return 0;
}
