#include <bits/stdc++.h>
using namespace std;
int const N = 3e5 + 3;
int n, m;
bitset<128> hashes[N];
vector<int> D[N];
bitset<128> setes[N];
bitset<128> hejho[N];
int label[N];
int repr[2 * N];
queue<int> bfs;
int main() {
  scanf("%d %d", &n, &m);
  srand(time(NULL));
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    D[a].push_back(b);
    D[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 16; j++) {
      int ro = rand() % 256;
      hashes[i] ^= ro;
      hashes[i] <<= 8;
    }
  }
  for (int i = 1; i <= n; i++) {
    setes[i] = hashes[i];
    for (int j = 0; j < D[i].size(); j++) {
      setes[i] ^= hashes[D[i][j]];
    }
  }
  bfs.push(1);
  label[1] = n;
  repr[n] = 1;
  int mi = n;
  int ma = n;
  while (bfs.empty() == false) {
    int l = bfs.front();
    int yo = label[l];
    for (int j = 0; j < D[l].size(); j++) {
      int u = D[l][j];
      if (label[u] == 0) {
        bfs.push(u);
        if (setes[u] == setes[repr[yo]])
          label[u] = yo;
        else if (setes[u] == setes[repr[yo + 1]] && repr[yo + 1] != 0)
          label[u] = yo + 1;
        else if (setes[u] == setes[repr[yo - 1]] && repr[yo - 1] != 0)
          label[u] = yo - 1;
        else if (repr[yo + 1] == 0) {
          label[u] = yo + 1;
          repr[yo + 1] = u;
          ma = yo + 1;
        } else if (repr[yo - 1] == 0) {
          label[u] = yo - 1;
          repr[yo - 1] = u;
          mi = yo - 1;
        } else {
          printf("NO");
          return 0;
        }
      }
    }
    bfs.pop();
  }
  for (int i = 1; i <= n; i++) {
    hejho[label[i] - mi] ^= hashes[i];
  }
  for (int i = mi; i <= ma; i++) {
    bitset<128> checker;
    if (i == mi)
      checker = setes[repr[i]] ^ hejho[i - mi] ^ hejho[i - mi + 1];
    else
      checker = setes[repr[i]] ^ hejho[i - mi] ^ hejho[i - mi + 1] ^
                hejho[i - mi - 1];
    if (checker != 0) {
      printf("NO");
      return 0;
    }
  }
  printf("YES \n");
  for (int i = 1; i <= n; i++) {
    printf("%d \n", label[i]);
  }
  return 0;
}
