#include <bits/stdc++.h>
using namespace std;
struct Interval {
 public:
  int t, l, r;
  Interval(int t, int l, int r) : t(t), l(l), r(r) {}
};
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<Interval> intervals;
  vector<int> sorted(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    if (t == 1) {
      sorted[l] += 1;
      sorted[r] -= 1;
    }
    intervals.push_back(Interval(t, l, r));
  }
  vector<int> diff(n, -1);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += sorted[i];
    if (sum > 0) {
      diff[i] = 0;
    }
  }
  vector<int> ans(n, 0);
  ans[0] = n;
  for (int i = 1; i < n; i++) {
    ans[i] = ans[i - 1] + diff[i];
  }
  bool ok = true;
  for (int i = 0; i < m; i++) {
    if (intervals[i].t == 1) {
      if (ans[intervals[i].l - 1] > ans[intervals[i].r - 1]) {
        ok = false;
        break;
      }
    } else {
      if (ans[intervals[i].l - 1] <= ans[intervals[i].r - 1]) {
        ok = false;
        break;
      }
    }
  }
  if (ok) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << "\n";
  } else {
    cout << "NO\n";
  }
}
