#include <bits/stdc++.h>
using namespace std;
int order[1005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a[1005];
  vector<pair<int, int> > v;
  for (int i = 0; i < m; i++) {
    int t, l, r;
    scanf("%d %d %d", &t, &l, &r);
    if (t == 1) {
      for (int j = l; j < r; j++) {
        order[j] = 1;
      }
    } else {
      v.push_back(make_pair(l, r));
    }
  }
  int ok = 1;
  for (auto it : v) {
    int ook = 0;
    for (int i = it.first; i < it.second; i++) {
      if (!order[i]) ook = 1;
    }
    if (!ook) ok = 0;
  }
  if (!ok) {
    printf("NO\n");
  } else {
    printf("YES\n");
    int last = 1005;
    printf("%d ", last);
    for (int i = 2; i <= n; i++) {
      if (!order[i - 1]) {
        last--;
      }
      printf("%d ", last);
    }
    printf("\n");
  }
}
