#include <bits/stdc++.h>
using namespace std;
int n, m, xa, xb;
pair<int, int> a[1002], b[1002];
int dd[1002];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int type, l, r;
    cin >> type >> l >> r;
    if (type == 1)
      a[++xa] = {l, r};
    else
      b[++xb] = {l, r};
  }
  sort(a + 1, a + xa + 1);
  for (int i = 1; i < xa; i++) {
    if (a[i].second >= a[i + 1].first) {
      a[i].second = max(a[i].second, a[i + 1].second);
      for (int j = i + 1; j < xa; j++) a[j] = a[j + 1];
      i--;
      xa--;
    }
  }
  for (int i = 1; i <= xa; i++) {
    for (int j = 1; j <= xb; j++)
      if (a[i].first <= b[j].first && a[i].second >= b[j].second) {
        cout << "NO";
        return 0;
      }
  }
  for (int i = 1; i <= xa; i++)
    for (int j = a[i].first + 1; j <= a[i].second; j++) dd[j] = 1;
  int x = 1e5;
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    if (dd[i] == 0) x--;
    cout << x << ' ';
  }
  return 0;
}
