#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, i, l, r, t, j, seg;
  cin >> n >> m;
  vector<pair<int, int>> un;
  vector<pair<int, int>> so;
  for (i = 0; i < m; i++) {
    cin >> t >> l >> r;
    if (t == 1) {
      so.push_back({l, r});
    } else {
      un.push_back({l, r});
    }
  }
  if (so.size() == 0) {
    cout << "YES" << endl;
    for (int i = 0; i <= n - 1; i++) {
      cout << n - i << " ";
    }
  } else {
    sort(so.begin(), so.end());
    int segment[1001] = {0};
    seg = 1;
    for (i = so[0].first; i <= so[0].second; i++) {
      segment[i] = 1;
    }
    int maxr = so[0].second;
    for (i = 1; i < so.size(); i++) {
      seg += (so[i].first > maxr);
      maxr = max(maxr, so[i].second);
      for (j = so[i].first; j <= so[i].second; j++) {
        segment[j] = seg;
      }
    }
    int bc = -1;
    for (j = 0; j < un.size(); j++) {
      bc = -1;
      int same = segment[un[j].first];
      for (i = un[j].first + 1; i <= un[j].second; i++) {
        if (segment[i] == 0 || segment[i] != same) {
          bc = 0;
          break;
        }
      }
      if (bc == -1) {
        break;
      }
    }
    if (bc == -1 && un.size() != 0) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      int ny = 1000;
      cout << ny << " ";
      int curr = segment[1];
      for (i = 2; i <= n; i++) {
        ny -= (segment[i] != curr || (segment[i] == 0));
        cout << ny << " ";
        curr = segment[i];
      }
    }
  }
  return 0;
}
