#include <bits/stdc++.h>
using namespace std;
int facts[1002][3], v[1002];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> facts[i][0] >> facts[i][1] >> facts[i][2];
    if (facts[i][0] == 1) {
      for (int j = facts[i][1]; j < facts[i][2]; ++j) v[j] = 1;
    }
  }
  for (int i = 1; i <= m; ++i) {
    bool verif = false;
    if (facts[i][0] == 0) {
      for (int j = facts[i][1]; j < facts[i][2]; ++j)
        if (v[j] == 0) {
          verif = true;
          break;
        }
      if (verif == false) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  int y = n + 1;
  cout << "YES" << endl;
  for (int i = 1; i <= n; ++i) {
    if (v[i - 1] == 1)
      cout << y << " ";
    else
      cout << --y << " ";
  }
  return 0;
}
