#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const int maxn = 1e5 + 10;
const int N = 2e6 + 100;
int num[maxn];
int ans[maxn];
vector<pair<int, int> > v;
int main() {
  int n, m;
  cin >> n >> m;
  while (m--) {
    int t, l, r;
    cin >> t >> l >> r;
    if (t) {
      for (int i = l; i < r; i++) num[i] = 1;
    } else {
      v.push_back(make_pair(l, r));
    }
  }
  ans[1] = n;
  for (int i = 2; i <= n; i++) {
    if (num[i - 1])
      ans[i] = ans[i - 1];
    else
      ans[i] = ans[i - 1] - 1;
  }
  for (int i = 0; i < v.size(); i++) {
    if (ans[v[i].first] == ans[v[i].second]) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
