#include <bits/stdc++.h>
using namespace std;
int n, m, t[1003], l[1003], r[1003], a[1003], s[1003];
vector<pair<int, int>> srt[2];
bool fnd = 1;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> t[i] >> l[i] >> r[i];
    if (t[i])
      for (int j = l[i] + 1; j <= r[i]; j++) s[j] = 1;
    srt[t[i]].push_back(make_pair(l[i], r[i]));
  }
  for (int i = 1; i <= n; i++) a[i] = 2000;
  sort(srt[0].begin(), srt[0].end());
  for (int i = 0; i < srt[0].size(); i++) {
    for (int j = srt[0][i].first + 1; j <= srt[0][i].second; j++)
      if (!s[j]) {
        a[j] = a[j - 1] - 1;
        break;
      }
  }
  for (int i = 1; i <= m; i++) {
    bool f = 1;
    for (int j = l[i] + 1; j <= r[i]; j++) f &= !(a[j - 1] > a[j]);
    if (f != t[i]) {
      fnd = 0;
      break;
    }
  }
  if (!fnd) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
