#include <bits/stdc++.h>
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
const int M = 3e5 + 500;
int n, m, Base = 13131;
std::vector<int> G[M], F[M];
long long H[M];
int idx[M], fa[M], res[M];
long long Hash(int x) {
  sort(G[x].begin(), G[x].end());
  long long res = 0;
  for (std::vector<int>::iterator it = G[x].begin(); it != G[x].end(); ++it) {
    res = res * Base + *it;
  }
  return res;
}
bool cmp(int a, int b) { return H[a] < H[b]; }
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= n; i++) G[i].push_back(i);
  for (int i = 1, u, v; i <= m; i++) {
    read(u);
    read(v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) H[i] = Hash(i), idx[i] = i;
  ;
  sort(idx + 1, idx + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    int x = idx[i], y = idx[i - 1];
    fa[x] = (H[x] != H[y]) ? x : fa[y];
  }
  for (int i = 1; i <= n; i++) {
    for (std::vector<int>::iterator it = G[i].begin(); it != G[i].end(); ++it) {
      int j = *it;
      if (fa[i] != fa[j]) F[fa[i]].push_back(fa[j]);
    }
  }
  int st;
  for (int i = 1; i <= n; i++) {
    if (fa[i] != i) continue;
    sort(F[i].begin(), F[i].end());
    F[i].erase(unique(F[i].begin(), F[i].end()), F[i].end());
    if (F[i].size() > 2) return puts("NO"), 0;
    if (F[i].size() <= 1) st = i;
  }
  queue<int> Q;
  Q.push(st);
  res[st] = 1;
  while (!Q.empty()) {
    int o = Q.front();
    Q.pop();
    for (std::vector<int>::iterator it = F[o].begin(); it != F[o].end(); ++it) {
      if (!res[*it]) Q.push(*it), res[*it] = res[o] + 1;
    }
  }
  puts("YES");
  for (int i = 1; i <= n; i++) {
    printf("%d ", res[fa[i]]);
  }
  puts("");
  return 0;
}
