#include <bits/stdc++.h>
using namespace std;
const double Pi = acos(-1);
vector<pair<int, int> > seg0;
vector<bool> good;
vector<int> a;
int n, m;
void Solve() {
  for (pair<int, int> lr : seg0) {
    int l = lr.first, r = lr.second;
    bool ok = false;
    for (int i = l; i < r; i++)
      if (a[i] > a[i + 1]) {
        ok = true;
        break;
      }
    if (!ok) {
      cout << "NO";
      return;
    }
  }
  cout << "YES\n";
  int Min = *min_element(a.begin(), a.end());
  for (int i = 1; i <= n; i++) cout << a[i] - Min + 1 << ' ';
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin >> n >> m;
  good.resize(n + 1);
  a.resize(n + 1);
  for (int i = 0; i < m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    if (!t)
      seg0.push_back(pair<int, int>(l, r));
    else
      for (int j = l + 1; j <= r; j++) good[j] = 1;
  }
  a[1] = 0;
  for (int i = 2; i <= n; i++)
    if (good[i])
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1] - 1;
  Solve();
  return 0;
}
