#include <bits/stdc++.h>
using namespace std;
int i, j;
long long n, q, Q, t, T, m, k;
int a[1001];
int def = (int)1e8;
vector<pair<int, int> > f[2];
set<pair<int, int> > on;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  const int drop = n + 5;
  for (i = 0; i < m; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    b--;
    c--;
    f[a].push_back(make_pair(b, c));
  }
  for (i = 0; i < f[1].size(); i++) {
    for (j = 0; j < f[0].size(); j++) {
      if (f[1][i].first <= f[0][j].first && f[1][i].second >= f[0][j].second) {
        cout << "NO" << endl;
        exit(0);
      }
    }
  }
  for (i = 0; i < n; i++) {
    auto it = on.begin();
    while (on.size() > 0 && it != on.end()) {
      if ((*it).second < i)
        it = on.erase(it);
      else
        it++;
    }
    if (on.size() == 0) {
      def -= drop;
    }
    a[i] = def;
    def++;
    for (j = 0; j < f[1].size(); j++)
      if (f[1][j].first == i) on.insert(f[1][j]);
  }
  for (i = 0; i < f[0].size(); i++) {
    bool fl = 0;
    for (j = f[0][i].first + 1; j < f[0][i].second + 1; j++) {
      if (a[j] < a[j - 1]) fl = 1;
    }
    if (!fl) {
      cout << "NO" << endl;
      exit(0);
    }
  }
  cout << "YES" << endl;
  for (i = 0; i < n; i++) {
    if (i) cout << " ";
    cout << a[i];
  }
  cout << endl;
}
