#include <bits/stdc++.h>
using namespace std;
int n, m;
struct date {
  int t, l, r;
};
date v[1001];
int sol[1001];
bool comp(date a, date b) {
  if (a.r > b.r)
    return 1;
  else if (a.r == b.r && a.l < b.l)
    return 1;
  return 0;
}
pair<int, int> intervale[10001];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> v[i].t >> v[i].l >> v[i].r;
  sort(v + 1, v + m + 1, comp);
  int lg = 0;
  for (int i = 1; i <= m; i++)
    if (v[i].t == 1) {
      bool pus = 0;
      for (int j = 1; j <= lg; j++)
        if (!(v[i].l > intervale[j].second || v[i].r < intervale[j].first)) {
          pus = 1;
          intervale[j].first = min(intervale[j].first, v[i].l);
          intervale[j].second = max(intervale[j].second, v[i].r);
        }
      if (!pus) {
        lg++;
        intervale[lg].first = v[i].l;
        intervale[lg].second = v[i].r;
      }
    }
  for (int i = 1; i <= m; i++)
    if (v[i].t == 0) {
      for (int j = 1; j <= lg; j++)
        if (v[i].l >= intervale[j].first && v[i].r <= intervale[j].second) {
          cout << "NO";
          return 0;
        }
    }
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) sol[i] = n - i + 1;
  for (int i = 1; i <= lg; i++) {
    int lungime = (intervale[i].second - intervale[i].first + 1);
    int adunat = intervale[i].first - 1;
    for (int j = 1; j <= lungime / 2; j++)
      swap(sol[j + adunat], sol[lungime - j + 1 + adunat]);
  }
  for (int i = 1; i <= n; i++) cout << sol[i] << " ";
  return 0;
}
