#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 10;
int n, m, to[M], c1, c0, ans[M];
struct d {
  int l, r;
  bool operator<(const d a) const { return r > a.r; }
} t1[M], t0[M];
int fnd(int x) {
  if (to[x] == x) return x;
  return to[x] = fnd(to[x]);
}
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) to[i] = i;
  for (int i = 1; i <= m; i++) {
    int t, l, r;
    scanf("%d%d%d", &t, &l, &r);
    if (t)
      t1[++c1].l = l, t1[c1].r = r;
    else
      t0[++c0].l = l, t0[c0].r = r;
  }
  sort(t1 + 1, t1 + 1 + c1);
  for (int i = 1; i <= c1; i++) {
    int l = t1[i].l, r = t1[i].r;
    for (int j = r - 1; j >= l; j--) to[j] = fnd(j + 1);
  }
  for (int i = n; i >= 1; i--)
    ans[i] = ans[i + 1] + (to[i] != to[i + 1] ? 1 : 0);
  for (int i = 1; i <= c0; i++) {
    int bad = 1, l = t0[i].l, r = t0[i].r;
    for (int j = l; j <= r - 1; j++)
      if (to[j] != to[j + 1]) {
        bad = 0;
        break;
      }
    if (bad) return 0 * printf("NO\n");
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
