#include <bits/stdc++.h>
using namespace std;
const int N = 1004;
int a[N], n, m, x, y, o;
bool b[N];
vector<pair<int, int> > v;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d %d", &o, &x, &y);
    if (o) {
      for (int i = x; i < y; i++) b[i] = 1;
    } else
      v.push_back(pair<int, int>(x, y));
  }
  a[1] = 2000;
  for (int i = 1; i < n; i++)
    if (b[i])
      a[i + 1] = a[i] + 1;
    else
      a[i + 1] = a[i] - 1;
  bool f = 1;
  for (int i = 0; i < v.size(); i++) {
    int l = v[i].first, r = v[i].second;
    bool g = 0;
    for (int i = l; i < r; i++)
      if (a[i] > a[i + 1]) g = 1;
    if (!g) f = 0;
  }
  if (!f)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  }
}
