#include <bits/stdc++.h>
using namespace std;
const int N = 300005, BAS = 351317;
int n, m, id;
int o[N], fa[N], dis[N];
long long ha[N];
vector<int> g[N], f[N];
queue<int> Q;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x, y; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) {
    o[i] = i;
    g[i].push_back(i);
    sort(g[i].begin(), g[i].end());
    for (int j : g[i]) ha[i] = ha[i] * BAS + j;
  }
  sort(o + 1, o + 1 + n, [](int x, int y) { return ha[x] < ha[y]; });
  for (int i = 1; i <= n; ++i) {
    int x = o[i], y = o[i - 1];
    fa[x] = (ha[x] != ha[y]) ? x : fa[y];
  }
  for (int i = 1; i <= n; ++i) {
    for (int j : g[i]) {
      if (fa[i] != fa[j]) f[fa[i]].push_back(fa[j]);
    }
  }
  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) {
      puts("NO");
      return 0;
    }
    if (f[i].size() <= 1) {
      id = i;
    }
  }
  dis[id] = 1;
  Q.push(id);
  for (; !Q.empty();) {
    int x = Q.front();
    Q.pop();
    for (int v : f[x]) {
      if (!dis[v]) dis[v] = dis[x] + 1, Q.push(v);
    }
  }
  puts("YES");
  for (int i = 1; i <= n; ++i) {
    printf("%d%c", dis[fa[i]], " \n"[i == n]);
  }
  return 0;
}
