#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, m;
vector<pair<int, int> > g[2];
int a[maxn];
int ans[maxn];
int vis[maxn];
int main() {
  cin >> n >> m;
  int t, l, r;
  for (int i = 1; i <= m; i++) {
    cin >> t >> l >> r;
    g[t].push_back({l, r});
  }
  for (int i = 0; i < g[1].size(); i++) {
    l = g[1][i].first, r = g[1][i].second;
    a[l]++;
    a[r]--;
  }
  vector<int> pre0(n + 5, 0);
  for (int i = 1; i <= n; i++) {
    a[i] += a[i - 1];
    pre0[i] = pre0[i - 1] + (a[i] == 0);
  }
  for (int i = 0; i < g[0].size(); i++) {
    int l = g[0][i].first, r = g[0][i].second;
    if (pre0[r - 1] - pre0[l - 1] == 0) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  ans[1] = 2000;
  for (int i = 2; i <= n; i++) {
    if (a[i - 1]) {
      ans[i] = ans[i - 1];
    } else {
      ans[i] = ans[i - 1] - 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
