#include <bits/stdc++.h>
using namespace std;
long long ans[1005] = {0};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, n, m;
  {
    cin >> n >> m;
    vector<pair<long long, long long>> arr, brr;
    for (i = 1; i <= m; i++) {
      long long t, l, r;
      cin >> t >> l >> r;
      if (t)
        arr.push_back({l, r});
      else
        brr.push_back({l, r});
    }
    sort(arr.begin(), arr.end());
    sort(brr.begin(), brr.end());
    long long cnt = 2004;
    long long pre = -1;
    for (pair<long long, long long> k : arr) {
      if (k.first <= pre)
        for (i = pre + 1; i <= k.second; i++) ans[i] = cnt;
      else {
        cnt -= 2;
        for (i = k.first; i <= k.second; i++) ans[i] = cnt;
      }
      pre = max(pre, k.second);
    }
    cnt = 3000;
    for (pair<long long, long long> k : brr) {
      for (i = k.first; i < k.second; i++)
        if (ans[i] && ans[i + 1] && ans[i] > ans[i + 1]) break;
      if (i < k.second) continue;
      if (ans[k.first]) {
        for (i = k.first; i <= k.second; i++) {
          if (!ans[i]) {
            ans[i] = ans[k.first] - 1;
            break;
          }
        }
        if (i > k.second) {
          cout << "NO";
          return 0;
        }
      } else
        ans[k.first] = --cnt;
    }
    for (i = 1; i <= n; i++)
      if (!ans[i]) ans[i] = 1;
    cout << "YES\n";
    for (i = 1; i <= n; i++) cout << ans[i] << " ";
  }
}
