#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "URDL";
const long long MOD2 = (long long)1000000007 * (long long)1000000007;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int a[1035];
vector<pair<int, int> > vp[2];
void fmain(int tid) {
  scanf("%d%d", &n, &m);
  for (int(i) = 1; (i) <= (int)(m); (i)++) {
    int t, l, r;
    scanf("%d%d%d", &t, &l, &r);
    vp[t].push_back({l, r});
  }
  vector<pair<int, int> > tmp;
  sort(vp[1].begin(), vp[1].end());
  for (int(i) = 0; (i) < (int)(vp[1].size()); (i)++) {
    int l = vp[1][i].first, r = vp[1][i].second;
    if (tmp.empty() || tmp.back().second < l)
      tmp.push_back({l, r});
    else {
      maxtt(tmp[tmp.size() - 1].second, r);
    }
  }
  for (auto p : tmp) {
    for (int i = p.first, j = 10000; i <= p.second; i++, j += 2000) {
      a[i] = j;
    }
  }
  if (a[1] == 0) a[1] = (1000000000);
  for (int i = 2; i <= n; i++)
    if (a[i] == 0) a[i] = a[i - 1] - 1;
  for (auto p : vp[0]) {
    int l = p.first, r = p.second;
    bool ok = 0;
    for (int i = l; i < r; i++)
      if (a[i] > a[i + 1]) {
        ok = 1;
        break;
      }
    if (!ok) etp();
  }
  puts("YES");
  for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%d ", a[i]);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
