#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[2005][3];
int mark[2005];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
    if (a[i][0]) {
      for (int j = a[i][1]; j < a[i][2]; j++) {
        mark[j] = 1;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    bool ok = false;
    if (!a[i][0]) {
      for (int j = a[i][1]; j < a[i][2]; j++) {
        if (!mark[j]) {
          ok = true;
          break;
        }
      }
      if (!ok) {
        printf("NO\n");
        return 0;
      }
    }
  }
  int ans = 2000;
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    if (!mark[i - 1]) ans--;
    cout << ans << " ";
  }
  return 0;
}
