#include <bits/stdc++.h>
using namespace std;
int i, j;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> ans(n + 1, 1000), order(n + 1);
  vector<pair<int, int>> query;
  while (m--) {
    int t, l, r;
    cin >> t >> l >> r;
    if (t == 1) {
      for (i = l + 1; i <= r; i++) {
        order[i] = 1;
      }
    } else
      query.push_back({l, r});
  }
  ans[1] = n;
  for (i = 2; i <= n; i++) {
    if (order[i])
      ans[i] = ans[i - 1];
    else
      ans[i] = ans[i - 1] - 1;
  }
  for (auto q : query) {
    int l = q.first;
    int r = q.second;
    bool check = false;
    for (i = l; i < r; i++) {
      if (ans[i] > ans[i + 1]) check = true;
    }
    if (!check) {
      cout << "NO" << '\n';
      return;
    }
  }
  cout << "YES" << '\n';
  for (i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << '\n';
}
int main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
