#include <bits/stdc++.h>
using namespace std;
int n, m, u, v, val = 0, gm[300010], ans[300010];
vector<int> g[300010], ng[300010];
set<int> st;
map<vector<int>, int> mp;
bool flag = 0, flag2 = 0, vis[300010] = {0}, ch[300010] = {0};
void dfs(int i, int p) {
  if (ng[i].size() > 2) {
    flag = 1;
    return;
  }
  vis[i] = 1;
  for (const auto& it : ng[i]) {
    if ((it != p) && (vis[it])) {
      flag = 1;
    }
    if ((!flag) && (it != p)) {
      ans[it] = ans[i] + 1;
      dfs(it, i);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    g[i].push_back(i);
    sort(g[i].begin(), g[i].end());
    u = mp[g[i]];
    if (!u) {
      u = mp[g[i]] = ++val;
    }
    gm[i] = u;
  }
  for (int i = 1; i <= n; i++) {
    u = gm[i];
    if (!ch[u]) {
      for (const auto& it : g[i]) {
        if (gm[it] != u) st.insert(gm[it]);
      }
      while (st.begin() != st.end()) {
        ng[u].push_back(*(st.begin()));
        st.erase(st.begin());
      }
      ch[u] = 1;
    }
  }
  for (int i = 1; i <= val; i++) {
    if (ng[i].size() <= 1 && (!flag2)) {
      ans[i] = 1;
      dfs(i, 0);
      flag2 = 1;
    }
  }
  if (!flag2) flag = 1;
  if (flag) {
    printf("NO");
  } else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      printf("%d ", ans[gm[i]]);
    }
  }
  return 0;
}
