#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int n, m, l, r, t;
int a[N];
bool srt[N];
vector<pair<int, int>> v[2];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  while (m--) {
    cin >> t >> l >> r;
    v[t].push_back({l, r});
  }
  for (int i = 0; i < v[1].size(); i++)
    for (int j = v[1][i].first; j < v[1][i].second; j++) srt[j] = 1;
  bool yes;
  for (int i = 0; i < v[0].size(); i++) {
    yes = 0;
    for (int j = v[0][i].first; j < v[0][i].second; j++) {
      if (!srt[j]) {
        yes = 1;
        break;
      }
    }
    if (!yes) break;
  }
  if (yes) {
    cout << "YES\n";
    a[0] = 1e6;
    cout << a[0] << ' ';
    for (int i = 1; i < n; i++) {
      if (srt[i])
        a[i] = a[i - 1] + 1;
      else
        a[i] = a[i - 1] - 1;
      cout << a[i] << ' ';
    }
  } else
    cout << "NO";
  return 0;
}
