#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, -1, 0, 1, -1, 0, 1};
int kx8[] = {1, 1, 2, 2, -1, -1, -2, -2};
int ky8[] = {2, -2, 1, -1, 2, -2, 1, -1};
int sum[1005];
vector<pair<long long, long long> > b;
vector<int> a[1005];
int v[1005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (m); i++) {
    int typ, l, r;
    cin >> typ >> l >> r;
    if (typ == 1) {
      a[l].push_back(r + 1);
    } else
      b.push_back({l, r});
  }
  int cnt = 1e5, pre = 0;
  for (int i = 1; i <= n; i++) {
    sum[i] += sum[i - 1];
    if (!sum[i]) {
      cnt--;
      pre = cnt;
    }
    v[i] = pre;
    for (auto x : a[i]) {
      sum[i]++;
      sum[x]--;
    }
  }
  for (auto x : b) {
    int pre = 0;
    bool flg = 0;
    for (int i = x.first; i <= x.second; i++) {
      if (v[i] >= pre)
        ;
      else {
        flg = 1;
        break;
      }
      pre = v[i];
    }
    if (!flg) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < (n); i++) cout << v[i + 1] << " ";
  cout << endl;
  return 0;
}
