#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> s, ns;
  for (int t, l, r, i = 0; i < m; ++i) {
    cin >> t >> l >> r;
    --l, --r;
    if (t == 1)
      s.push_back({l, r});
    else
      ns.push_back({l, r});
  }
  auto cs = s;
  vector<int> a(n);
  for (int i = 0; i < s.size(); ++i)
    for (int j = i + 1; j < s.size(); ++j) {
      if (s[j].first <= s[i].second && s[j].second >= s[i].first) {
        s[i].first = min(s[i].first, s[j].first);
        s[i].second = max(s[i].second, s[j].second);
        s.erase(s.begin() + j);
        --i;
        break;
      }
      swap(s[i], s[j]);
      if (s[j].first <= s[i].second && s[j].second >= s[i].first) {
        s[i].first = min(s[i].first, s[j].first);
        s[i].second = max(s[i].second, s[j].second);
        s.erase(s.begin() + j);
        --i;
        break;
      }
      swap(s[i], s[j]);
    }
  sort(s.begin(), s.end());
  int k = n + 1, p = 0;
  for (int i = 0; i < n; ++i, --k) {
    if (p < s.size() && s[p].first == i) {
      for (; i <= s[p].second; ++i) a[i] = k;
      --i;
      ++p;
      continue;
    }
    a[i] = k;
  }
  auto sorted = [&](int l, int r) {
    bool ok = true;
    int last = -1;
    for (; l <= r; ++l) {
      ok &= a[l] >= last;
      last = a[l];
    }
    return ok;
  };
  bool ok = true;
  for (auto i : cs) ok &= sorted(i.first, i.second);
  for (auto i : ns) ok &= !sorted(i.first, i.second);
  if (ok) {
    cout << "YES\n";
    for (auto &i : a) cout << i << " \n"[&i == &a.back()];
  } else
    cout << "NO\n";
  return 0;
}
