#include <bits/stdc++.h>
using namespace std;
struct cre {
  int l, r;
  cre(int _l, int _r) : l(_l), r(_r) {}
  bool operator<(const cre& o) const { return l < o.l; }
};
vector<cre> seg[2], a;
int n, m;
int ans[1005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  int id, x, y;
  for (int i = 1; i <= m; i++) {
    cin >> id >> x >> y;
    seg[id].push_back(cre(x, y));
  }
  if (seg[1].empty()) {
    cout << "YES" << endl;
    for (int i = n; i >= 1; i--) {
      cout << i << " ";
    }
    cout << endl;
    return 0;
  }
  sort(seg[1].begin(), seg[1].end());
  int nowl = 0, nowr = 0;
  for (auto& it : seg[1]) {
    if (nowr < it.l) {
      if (nowr > 0) a.push_back(cre(nowl, nowr));
      nowl = it.l;
      nowr = it.r;
    } else {
      nowr = max(it.r, nowr);
    }
  }
  a.push_back(cre(nowl, nowr));
  int now = 10000000;
  ans[1] = now;
  int pre = 0;
  for (auto& it : a) {
    for (int i = pre + 1; i <= it.l; i++) {
      ans[i] = --now;
    }
    for (int i = it.l + 1; i <= it.r; i++) {
      ans[i] = now;
    }
    pre = it.r;
  }
  if (pre < n) {
    for (int i = pre + 1; i <= n; i++) {
      ans[i] = --now;
    }
  }
  for (auto& it : seg[0]) {
    bool flag = 0;
    for (int i = it.l; i < it.r; i++) {
      if (ans[i] > ans[i + 1]) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
