#include <bits/stdc++.h>
using namespace std;
int a[1001], n, m;
vector<pair<int, int>> quer;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) a[i] = -1;
  for (int i = 0; i < m; i++) {
    int l, r, t;
    cin >> t >> l >> r;
    if (t == 0)
      quer.push_back(make_pair(l, r));
    else {
      for (int j = l + 1; j <= r; j++) a[j] = 0;
    }
  }
  a[1] = n;
  for (int i = 2; i <= n; i++) a[i] += a[i - 1];
  for (int i = 0; i < quer.size(); i++) {
    int c = 0;
    for (int j = quer[i].first; j < quer[i].second; j++) {
      if (a[j] > a[j + 1]) {
        c = 1;
        break;
      }
    }
    if (c == 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
