#include <bits/stdc++.h>
using namespace std;
int n, m, a[1004];
vector<pair<int, int> > P[2];
void getres() {
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) a[i] = a[i - 1] - 1;
  for (int j = 0; j < P[0].size(); j++) {
    pair<int, int> cur = P[0][j];
    int l = cur.first, r = cur.second;
    bool ok = false;
    for (int i = l; i < r; i++)
      if (a[i] > a[i + 1]) {
        ok = true;
        break;
      }
    if (ok == 0) {
      cout << "NO" << '\n';
      return;
    }
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  cout << '\n';
}
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    P[t].push_back({l, r});
  }
  sort(P[1].begin(), P[1].end());
  int val = 1e9;
  a[0] = val;
  for (int j = 0; j < P[1].size(); j++) {
    pair<int, int> cur = P[1][j];
    int l = cur.first;
    int r = cur.second;
    int ss = -1;
    for (int i = l; i <= r; i++)
      if (a[i] != 0) ss = a[i];
    if (ss == -1) ss = val - 1002;
    val -= 1002;
    for (int i = l; i <= r; i++) a[i] = ss;
  }
  getres();
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
