#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 3;
int n, m, a[N], c = 5000;
pair<pair<int, int>, int> p[N];
bool b[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> p[i].second >> p[i].first.first >> p[i].first.second;
    p[i].first.first--;
    p[i].first.second--;
  }
  a[0] = c;
  for (int i = 1; i < n; i++) {
    bool bb = 0;
    for (int j = 0; j < m; j++) {
      if (p[j].first.first < i && p[j].first.second >= i && p[j].second == 1) {
        bb = 1;
        break;
      }
    }
    if (bb == 1) {
      a[i] = a[i - 1];
    } else {
      a[i] = a[i - 1] - 1;
      for (int j = 0; j < m; j++) {
        if (p[j].first.first < i && p[j].first.second >= i &&
            p[j].second == 0) {
          b[j] = 1;
        }
      }
    }
  }
  for (int j = 0; j < m; j++) {
    if (p[j].second == 0 && b[j] == 0) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
}
