#include <bits/stdc++.h>
using namespace std;
long long par[1005], size[1005];
int find_set(int v) {
  if (v == par[v]) return v;
  return par[v] = find_set(par[v]);
}
void make_set(int v) {
  par[v] = v;
  size[v] = 1;
}
void union_sets(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (size[a] < size[b]) swap(a, b);
    par[b] = a;
    size[a] += size[b];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, i, j, t, l, r;
  cin >> n >> m;
  for (i = 1; i <= n; i++) make_set(i);
  vector<pair<long long int, long long int> > v;
  vector<long long int> ans;
  for (i = 0; i < m; i++) {
    cin >> t >> l >> r;
    if (t == 0)
      v.push_back(make_pair(l, r));
    else {
      for (j = l; j <= r; j++) union_sets(l, j);
    }
  }
  for (auto j : v) {
    if (find_set(j.first) == find_set(j.second)) {
      cout << "NO";
      return 0;
    }
  }
  make_set(0);
  union_sets(0, 1);
  i = 1;
  long long nxt = 1000;
  long long st = 1000;
  cout << "YES\n";
  while (i <= n) {
    if (find_set(i) == find_set(i - 1)) {
      ans.push_back(st++);
      i++;
    } else {
      nxt--;
      st = nxt;
      ans.push_back(st++);
      i++;
    }
  }
  for (auto i : ans) cout << i << " ";
  return 0;
}
