#include <bits/stdc++.h>
using namespace std;
template <class T>
void printvec(vector<T>& x, int a, int b) {
  for (int i = (a); i <= (b); i++) cout << x[i] << " ";
  cout << "\n";
}
const double PI = acos((double)-1);
const double EPSILON = 1e-7;
const int N = 1e6 + 1;
const int NN = 1e3 + 1;
const long long MOD = 1e9 + 7;
const long long oo = LLONG_MAX;
const int BASE = 10000;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n + 1);
  vector<pair<int, int> > re1, re0;
  for (int i = 1; i <= m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    if (t) {
      re1.push_back({l, r});
    } else {
      re0.push_back({l, r});
    }
  }
  if (re1.size()) {
    sort((re1).begin(), (re1).end());
    vector<pair<int, int> > re;
    re.push_back(re1[0]);
    for (int i = 1; i < re1.size(); i++) {
      if (re1[i].first > re.back().second) {
        re.push_back(re1[i]);
      } else {
        re.back().second = max(re.back().second, re1[i].second);
      }
    }
    int cur = n;
    for (int i = 0; i < re.size(); i++) {
      cur--;
      for (int j = re[i].first; j <= re[i].second; j++) {
        a[j] = cur;
      }
      if (i == re.size() - 1) {
        break;
      }
      for (int j = re[i].second + 1; j <= re[i + 1].first - 1; j++) {
        a[j] = --cur;
      }
    }
  }
  a[0] = 1e9;
  for (int i = 1; i <= n; i++) {
    if (!a[i]) {
      a[i] = a[i - 1] - 1;
    }
  }
  for (auto x : re0) {
    int check = 0;
    for (int i = x.first + 1; i <= x.second; i++) {
      if (a[i] < a[i - 1]) {
        check = 1;
        break;
      }
    }
    if (!check) {
      cout << "NO";
      return;
    }
  }
  cout << "YES"
       << "\n";
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(10);
  solve();
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
  return 0;
}
