#include <bits/stdc++.h>
using namespace std;
int par[1010], rta[1010];
int n, m;
int findRoot(int x) { return par[x] < 0 ? x : (par[x] = findRoot(par[x])); }
void merge(int a, int b) {
  a = findRoot(a);
  b = findRoot(b);
  if (a == b) return;
  if (par[b] < par[a]) swap(a, b);
  par[a] += par[b];
  par[b] = a;
}
bool sameSet(int a, int b) { return findRoot(a) == findRoot(b); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  memset(par, -1, sizeof(par));
  int t, l, r;
  cin >> n >> m;
  vector<pair<int, int> > qs;
  for (int i = 0; i < m; i++) {
    cin >> t >> l >> r;
    l--;
    r--;
    if (t) {
      for (int i = l; i <= r; i++) {
        merge(i, l);
      }
    } else {
      qs.push_back({l, r});
    }
  }
  for (auto x : qs) {
    if (sameSet(x.first, x.second)) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  rta[0] = 2000;
  cout << rta[0];
  for (int i = 1; i < n; i++) {
    if (sameSet(i, i - 1)) {
      rta[i] = rta[i - 1] + 1;
    } else {
      rta[i] = rta[i - 1] - 1;
    }
    cout << " " << rta[i];
  }
  return 0;
}
