#include <bits/stdc++.h>
using namespace std;
int N, M;
int T[1010], L[1010], R[1010];
int up[1010];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N >> M;
  for (i = 0; i < (M); i++) {
    cin >> T[i] >> L[i] >> R[i];
    L[i]--, R[i]--;
    if (T[i] == 1) {
      for (x = L[i]; x < R[i]; x++) up[x] = 1;
    }
  }
  for (i = 0; i < (M); i++)
    if (T[i] == 0) {
      int ok = 0;
      for (x = L[i]; x < R[i]; x++)
        if (up[x] == 0) ok = 1;
      if (ok == 0) return (void)printf("NO\n");
    }
  int cur = 1010;
  cout << "YES" << endl;
  for (i = 0; i < (N); i++) {
    cout << cur << " ";
    if (up[i])
      cur++;
    else
      cur--;
  }
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
