#include <bits/stdc++.h>
using namespace std;
int n, m;
int cnt[1005], s[1005];
pair<int, int> p[1005];
int top;
int main() {
  cin >> n >> m;
  int l, r, t;
  for (int i = 1; i <= m; i++) {
    cin >> t >> l >> r;
    if (t)
      cnt[l]++, cnt[r]--;
    else
      p[++top] = make_pair(l, r);
  }
  for (int i = 1; i <= n; i++) {
    cnt[i] += cnt[i - 1];
    s[i] = s[i - 1] + (cnt[i] > 0);
  }
  for (int i = 1; i <= top; i++) {
    l = p[i].first;
    r = p[i].second - 1;
    if (s[r] - s[l - 1] == r - l + 1) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  int a = n + 1;
  for (int i = 1; i <= n; i++) {
    if (cnt[i - 1] == 0)
      cout << (--a) << ' ';
    else
      cout << a << ' ';
  }
  return 0;
}
