#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  int t, l, r;
  vector<pair<long long, long long> > qs[2];
  for (int i = 0; i < m; i++) {
    cin >> t >> l >> r;
    l--;
    r--;
    qs[t].emplace_back(l, r);
  }
  sort(qs[1].begin(), qs[1].end());
  sort(qs[0].begin(), qs[0].end());
  vector<pair<long long, long long> > new1, new0;
  if (qs[1].size() > 0) {
    new1.push_back(qs[1][0]);
  }
  for (size_t i = 1; i < qs[1].size(); i++) {
    if (new1.back().second >= qs[1][i].first) {
      new1[new1.size() - 1].second =
          max(new1[new1.size() - 1].second, qs[1][i].second);
    } else {
      new1.push_back(qs[1][i]);
    }
  }
  if (qs[0].size() > 0) {
    new0.push_back(qs[0][0]);
  }
  for (int i = 1; i < qs[0].size(); i++) {
    if (new0.back().second >= qs[0][i].first) {
      new0[new0.size() - 1].second =
          max(new0[new0.size() - 1].second, qs[0][i].second);
    } else {
      new0.push_back(qs[0][i]);
    }
  }
  vector<int> idx(n, 0);
  int cur = 1;
  for (auto it : new0) {
    for (auto test : new1) {
      if (it.first >= test.first && it.second <= test.second) {
        cout << "NO";
        return;
      }
    }
  }
  vector<int> ans(n, -1);
  long long st = 1000001;
  for (auto it : new1) {
    for (int j = it.first; j <= it.second; j++) {
      ans[j] = st + j - it.first;
    }
    st -= 1010;
  }
  int last = 1e7;
  for (int i = 0; i < n; i++) {
    if (ans[i] != -1) {
      last = ans[i] - 1;
    } else {
      ans[i] = last--;
    }
  }
  for (auto it : qs[0]) {
    bool ok = false;
    for (int j = it.first; j < it.second; j++) {
      if (ans[j] > ans[j + 1]) {
        ok = true;
        break;
      }
    }
    if (!ok) {
      cout << "NO";
      return;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
