#include <bits/stdc++.h>
using namespace std;
int endzero = 9999, endone = -1, pmax, posline[1005][5], ansnum, pointer, n,
    res, m, a, b, c;
bool fail;
int fmax(int j) {
  while (posline[j][1] != 0) {
    j = posline[j][1];
  }
  return j;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b >> c;
    if (a == 1) {
      posline[b][1] = max(posline[b][1], c);
    } else {
      if (posline[b][2] == 0)
        posline[b][2] = c;
      else
        posline[b][2] = min(posline[b][2], c);
    }
  }
  endone = -1;
  for (int i = 1; i <= n; i++) {
    if (endone <= 0 && posline[i][1] > 0) {
      endzero = 9999;
      endone = posline[i][1];
    } else
      endone = max(endone, posline[i][1]);
    if (posline[i][2] != 0) endzero = min(endzero, posline[i][2]);
    if (endzero <= endone) {
      fail = true;
      break;
    }
    if (endone == i) {
      endone = -1;
      endzero = 9999;
    }
  }
  if (fail)
    cout << "NO" << '\n';
  else {
    cout << "YES" << '\n';
    ansnum = 1000;
    pointer = 1;
    while (pointer <= n) {
      if (posline[pointer][1] > 0) {
        res = posline[pointer][1];
        while (pointer <= res && pointer <= n) {
          if (pointer == n)
            cout << ansnum << '\n';
          else
            cout << ansnum << ' ';
          res = max(res, posline[pointer][1]);
          ansnum++;
          pointer++;
        }
        ansnum -= 2;
      } else {
        if (pointer == n)
          cout << ansnum << '\n';
        else
          cout << ansnum << ' ';
        if (posline[pointer][2] != 0 && ansnum - 1 > 0) ansnum--;
        pointer++;
      }
    }
  }
}
