#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i;
  cin >> n >> m;
  int arr[n], ans[n];
  for (i = 0; i < n - 1; i++) {
    arr[i] = -1;
  }
  vector<pair<int, int>> v;
  for (i = 0; i < m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    if (t == 1) {
      for (int j = l - 1; j < r - 1; j++) {
        arr[j] = 0;
      }
    } else {
      v.push_back({l - 1, r - 1});
    }
  }
  ans[0] = n;
  for (i = 1; i < n; i++) {
    ans[i] = ans[i - 1] + arr[i - 1];
  }
  int flag = 0;
  for (i = 0; i < v.size(); i++) {
    flag = 0;
    for (int j = v[i].first + 1; j <= v[i].second; j++) {
      if (ans[j - 1] > ans[j]) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
