#include <bits/stdc++.h>
using namespace std;
int f[1005];
int find(int x) { return x == f[x] ? x : f[x] = find(f[x]); }
void unin(int x, int y) {
  int fx = find(x);
  int fy = find(y);
  if (fx != fy) {
    f[fy] = fx;
  }
}
struct myp {
  int t, l, p;
} go[1005];
int a[1005] = {0};
map<int, vector<int> > mp1;
map<int, int> mp2;
int cmp(myp a, myp b) { return a.p < b.p; }
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) f[i] = i;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d %d", &go[i].t, &go[i].l, &go[i].p);
    if (go[i].t == 1) {
      for (int j = go[i].l + 1; j <= go[i].p; j++) {
        unin(go[i].l, j);
      }
    }
  }
  sort(go + 1, go + 1 + m, cmp);
  for (int i = 1; i <= m; i++) {
    if (go[i].t == 0) {
      for (int j = go[i].l + 1; j <= go[i].p; j++) {
        mp2[find(j)] = mp2[find(j - 1)] - 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    a[i] = mp2[find(i)];
  }
  int flag = 1;
  for (int i = 1; i <= m; i++) {
    int l = go[i].l, r = go[i].p, t = go[i].t;
    if (t == 0) {
      int flag2 = 0;
      for (int j = l + 1; j <= r; j++) {
        if (a[j] < a[j - 1]) {
          flag2 = 1;
          break;
        }
      }
      flag = flag2;
    } else {
      int flag2 = 1;
      for (int j = l + 1; j <= r; j++) {
        if (a[j] < a[j - 1]) {
          flag2 = 0;
          break;
        }
      }
      flag = flag2;
    }
    if (flag == 0) break;
  }
  int maxn = -10000000;
  for (int i = 1; i <= n; i++) {
    maxn = max(maxn, 1 - a[i]);
  }
  if (flag) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      cout << a[i] + maxn << ' ';
    }
  } else
    cout << "NO" << endl;
}
