#include <bits/stdc++.h>
using namespace std;
int n, m, t, l, r, k;
int v[1001];
bool ok = true;
vector<pair<int, int> > up;
vector<int> down[1001];
bitset<1001> f;
bitset<1001> have;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m && ok; i++) {
    cin >> t >> l >> r;
    if (t == 0) {
      ++k;
      for (int j = l + 1; j <= r; j++) down[j].push_back(k);
    } else
      up.push_back(make_pair(l, r));
  }
  for (pair<int, int> p : up)
    for (int i = p.first + 1; i <= p.second; i++) f[i] = true;
  for (int i = 1; i <= n; i++)
    if (!f[i])
      for (int j : down[i]) have[j] = true;
  for (int i = 1; i <= k; i++)
    if (!have[i]) {
      ok = false;
      break;
    }
  if (!ok) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  int last = 10000;
  for (int i = 1; i <= n; i++) {
    if (!f[i] && down[i].size()) last--;
    cout << last << ' ';
  }
  return 0;
}
