#include <bits/stdc++.h>
using namespace std;
int A[300010], B[300010];
struct Q {
  int l, r, k;
} a[1010];
int cmp(Q b, Q c) {
  if (b.l == c.l) return b.r < c.r;
  return b.l < c.l;
}
int main() {
  int i, n, j, m, x;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) scanf("%d%d%d", &a[i].k, &a[i].l, &a[i].r);
  sort(a + 1, a + 1 + m, cmp);
  for (i = 1; i <= m; i++) {
    if (a[i].k) {
      if (A[a[i].l] == 0)
        x = (m - i + 1) * 10000;
      else
        x = A[a[i].l];
      for (j = a[i].l; j <= a[i].r; j++) A[j] = x;
    }
  }
  for (i = 1; i <= m; i++) {
    if (a[i].k == 0) {
      if (A[a[i].l] == A[a[i].r] && A[a[i].l]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  A[0] = 1e9;
  for (i = 1; i <= n; i++) {
    if (A[i] == 0) A[i] = A[i - 1] - 1;
    cout << A[i] << " ";
  }
  return 0;
}
