#include <bits/stdc++.h>
using namespace std;
int n, m, x, l, ri;
vector<pair<int, int> > nso, so;
int t[1003];
int r[1003];
int kolejny1 = 8000000;
int kolejny0 = 1999;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  t[1] = n + 2;
  for (int i = 1; i <= n; i++) r[i] = -1;
  for (int z = 1; z <= m; ++z) {
    cin >> x >> l >> ri;
    if (x)
      so.push_back(make_pair(l, ri));
    else
      nso.push_back(make_pair(l, ri));
    for (int i = l + 1; i <= ri; ++i) {
      if (x == 1) r[i] = 0;
    }
  }
  for (int i = 2; i <= n; ++i) {
    t[i] = t[i - 1] + r[i];
  }
  for (int z = 0; z < nso.size(); ++z) {
    pair<int, int> p = nso[z];
    int l = p.first;
    int ri = p.second;
    bool ok = false;
    for (int i = l + 1; i <= ri; i++) {
      if (t[i - 1] > t[i]) ok = true;
    }
    if (!ok) {
      cout << "NO\n";
      return 0;
    }
  }
  for (int z = 0; z < so.size(); ++z) {
    pair<int, int> p = so[z];
    int l = p.first;
    int ri = p.second;
    bool ok = true;
    for (int i = l + 1; i <= ri; i++) {
      if (t[i - 1] > t[i]) ok = false;
    }
    if (!ok) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; ++i) {
    cout << t[i] << " ";
  }
}
