#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
void no() {
  cout << "NO" << endl;
  exit(0);
}
const int N = 3e5 + 5;
vector<int> adj[N], g[N];
map<vector<int>, int> m;
int id[N], cor[N], cmx, cmn;
int vis[N];
int dif[2] = {-1, 1};
void dfs(int at, int add) {
  vis[at] = 4;
  cor[at] += add;
  cmx = max(cor[at], cmx);
  for (auto next : g[at])
    if (vis[next] != 4) dfs(next, add);
}
void dfs1(int at, int pai) {
  vis[at] = 1;
  if (g[at].size() >= 3) no();
  for (auto next : g[at]) {
    if (!vis[next])
      dfs1(next, at);
    else if (next != pai and vis[next] == 1)
      no();
  }
  vis[at] = 2;
}
void dfs(int at, int cor, int dir) {
  vis[at] = 1;
  ::cor[at] = cor;
  cmx = max(cmx, cor);
  cmn = min(cmn, cor);
  int ct = 0;
  for (auto next : g[at])
    if (!vis[next]) {
      if (!dir)
        dfs(next, cor + dif[ct], dif[ct]);
      else
        dfs(next, cor + dir, dir);
      ct++;
    }
}
int main(void) {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  while (m--) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    adj[i].push_back(i);
    sort(adj[i].begin(), adj[i].end());
    if (!::m.count(adj[i])) ::m[adj[i]] = ::m.size();
    id[i] = ::m[adj[i]];
  }
  for (int i = 1; i <= n; i++) {
    int u = id[i];
    for (auto next : adj[i]) {
      int v = id[next];
      if (v != u) {
        g[u].push_back(v);
        g[v].push_back(u);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    sort(g[i].begin(), g[i].end());
    g[i].resize(unique(g[i].begin(), g[i].end()) - g[i].begin());
  }
  for (int i = 1; i <= n; i++) dfs1(i, 0);
  memset(vis, 0, sizeof vis);
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      cmn = INF;
      int mx = cmx;
      dfs(i, cmx + 3, 0);
      dfs(i, mx - cmn + 3);
    }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << cor[id[i]] << " ";
  cout << endl;
  return 0;
}
