#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 5;
const long long mod = 99999997;
struct node {
  int t, l, r;
};
long long a[maxn], m, n;
bool cmp(node a, node b) { return a.t > b.t; }
node b[maxn];
bool bi[maxn];
int ans[maxn];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> b[i].t >> b[i].l >> b[i].r;
  }
  sort(b + 1, b + m + 1, cmp);
  for (int i = 1; i <= m; i++) {
    if (b[i].t == 1) {
      for (int j = b[i].l; j <= b[i].r - 1; j++) {
        bi[j] = 1;
      }
    } else {
      int ok = 1;
      for (int j = b[i].l; j <= b[i].r - 1; j++) {
        if (bi[j] == 0) {
          ok = 0;
          break;
        }
      }
      if (ok) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  int now = n;
  for (int i = 1; i <= n; i++) {
    ans[i] = now;
    if (bi[i] == 0 && i != n) now--;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
}
