#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
const int oo = 1e9 + 5;
int du[] = {-1, 0, 0, 1};
int dv[] = {0, -1, 1, 0};
const long long mod = 1e9 + 7;
long long sqr(long long x) { return x * x; }
int n, m, a[N + 5], b[N + 5], t[N + 5], l[N + 5], r[N + 5];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i < n; i++) b[i] = -1;
  for (int i = 1; i <= m; i++) cin >> t[i] >> l[i] >> r[i];
  for (int i = 1; i <= m; i++)
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i] - 1; j++) b[j] = 0;
    }
  a[1] = n;
  for (int i = 2; i <= n; i++) a[i] = a[i - 1] + b[i - 1];
  for (int i = 1; i <= m; i++)
    if (t[i] == 0) {
      int Max = a[l[i]];
      bool ok = false;
      for (int j = l[i] + 1; j <= r[i]; j++) {
        if (Max > a[j]) ok = true;
        Max = max(Max, a[j]);
      }
      if (!ok) {
        cout << "NO";
        return 0;
      }
    }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
