#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long n, k, t, m, q, x, flag = 0;
long long po(long long k, long long n, long long ans, long long temp,
             long long ans1) {
  if (n == 0) return ans;
  while (temp <= n) {
    ans *= ans1;
    ans %= mod;
    ans1 = ans1 * ans1;
    ans1 %= mod;
    n = n - temp;
    temp *= 2;
  }
  return po(k, n, ans, 1, k) % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  long long a[n], temp = 0;
  pair<int, int> pa[n];
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) a[i] = n - i;
  for (int j = 0; j < m; j++) {
    long long l, r;
    cin >> t >> l >> r;
    if (t == 1) {
      pa[temp] = make_pair(l, r);
      temp++;
    } else {
      pair<int, int> p;
      p = make_pair(l, r);
      v.push_back(p);
    }
  }
  sort(pa, pa + temp);
  for (int i = 0; i < temp; i++) {
    for (int j = pa[i].first; j < pa[i].second; j++) {
      a[j] = a[pa[i].first - 1];
    }
  }
  for (int i = 0; i < v.size(); i++) {
    long long temp = 0;
    for (int j = v[i].first - 1; j < v[i].second - 1; j++) {
      if (a[j] > a[j + 1]) {
        temp = 1;
        break;
      }
    }
    if (temp == 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES"
       << "\n";
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
