#include <bits/stdc++.h>
using namespace std;
const int Maxn = 3e5, Mod1 = 1e9 + 7, Mod2 = 1e9 + 9;
int n, m;
vector<int> g[Maxn];
struct Hash {
  int a, b;
  Hash(void) {}
  Hash(int _a, int _b) : a(_a), b(_b) {}
  bool operator<(const Hash& r) const { return a != r.a ? a < r.a : b < r.b; }
  bool operator==(const Hash& r) const { return a == r.a && b == r.b; }
} h[Maxn], hs[Maxn];
int cnths, newid[Maxn];
vector<int> newg[Maxn];
int ccid[Maxn], ccsize[Maxn], cntcc, endp[Maxn];
void Fill(int u) {
  ccid[u] = cntcc;
  ++ccsize[cntcc];
  if (newg[u].size() <= 1) {
    endp[cntcc] = u;
  }
  for (int v : newg[u]) {
    if (ccid[v] == -1) {
      Fill(v);
    }
  }
}
int label[Maxn];
void Dfs(int u) {
  for (int v : newg[u]) {
    if (label[v] == -1) {
      label[v] = label[u] + 1;
      Dfs(v);
    }
  }
}
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < n; ++i) {
    g[i].push_back(i);
    sort(g[i].begin(), g[i].end());
    g[i].erase(unique(g[i].begin(), g[i].end()), g[i].end());
    int a = 0, b = 0;
    for (int j : g[i]) {
      a = ((long long)(n + 1) * a + j + 1) % Mod1;
      b = ((long long)(n + 1) * b + j + 1) % Mod2;
    }
    h[i] = hs[i] = Hash(a, b);
  }
  sort(hs, hs + n);
  cnths = unique(hs, hs + n) - hs;
  for (int i = 0; i < n; ++i) {
    newid[i] = lower_bound(hs, hs + cnths, h[i]) - hs;
  }
  for (int i = 0; i < n; ++i) {
    for (int j : g[i]) {
      int u = newid[i], v = newid[j];
      if (u != v) {
        newg[u].push_back(v);
        newg[v].push_back(u);
      }
    }
  }
  for (int i = 0; i < cnths; ++i) {
    sort(newg[i].begin(), newg[i].end());
    newg[i].erase(unique(newg[i].begin(), newg[i].end()), newg[i].end());
    if ((int)newg[i].size() > 2) {
      puts("NO");
      return 0;
    }
  }
  memset(ccid, -1, sizeof ccid);
  memset(endp, -1, sizeof endp);
  memset(label, -1, sizeof label);
  for (int i = 0; i < cnths; ++i) {
    if (ccid[i] == -1) {
      Fill(i);
      ++cntcc;
    }
  }
  int tmp = 1;
  for (int i = 0; i < cntcc; ++i) {
    int x = endp[i];
    if (x == -1) {
      puts("NO");
      return 0;
    }
    label[x] = tmp;
    Dfs(x);
    tmp += ccsize[i] + 1;
  }
  puts("YES");
  for (int i = 0; i < n; ++i) {
    printf("%d ", label[newid[i]]);
  }
  putchar('\n');
  return 0;
}
