#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long maxn = 1010;
int n, m, t[maxn], l[maxn], r[maxn];
bool mark[maxn];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> t[i] >> l[i] >> r[i];
    if (t[i]) {
      for (int j = l[i]; j < r[i]; ++j) mark[j] = true;
    }
  }
  for (int i = 1; i <= m; ++i) {
    bool flag = false;
    if (!t[i]) {
      for (int j = l[i]; j < r[i]; ++j)
        if (!mark[j]) {
          flag = true;
          break;
        }
      if (!flag) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  int ans = n + 1;
  cout << "YES" << endl;
  for (int i = 1; i <= n; ++i) {
    if (mark[i - 1])
      cout << ans << " ";
    else
      cout << --ans << " ";
  }
  return 0;
}
