#include <bits/stdc++.h>
using namespace std;
class dsu {
 private:
  int size;
  vector<int> p, r;

 public:
  dsu(int x) : size(x) {
    for (int i = 0; i < x; i++) {
      p.push_back(i);
      r.push_back(1);
    }
  }
  int find(int x) {
    if (p[x] == x) return x;
    return p[x] = find(p[x]);
  }
  void join(int x, int y) {
    x = find(x);
    y = find(y);
    if (x != y) {
      if (r[x] < r[y])
        p[x] = y;
      else
        p[y] = x;
      if (r[x] == r[y]) r[x]++;
    }
  }
};
int n, m;
vector<int> adj[300011];
map<vector<int>, int> rep;
set<int> adjset[300011];
int ans[300011];
void dfs(int v, int cnt) {
  ans[v] = cnt;
  for (int u : adjset[v]) {
    if (ans[u] == 0) dfs(u, cnt + 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  dsu uf(n);
  while (m--) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    adj[i].push_back(i);
    sort(adj[i].begin(), adj[i].end());
    if (rep.find(adj[i]) == rep.end())
      rep[adj[i]] = i;
    else
      uf.join(i, rep[adj[i]]);
  }
  int s = -1;
  for (int i = 0; i < n; i++) {
    int u = uf.find(i);
    for (int x : adj[i]) {
      int v = uf.find(x);
      if (u != v) adjset[u].insert(v);
    }
    if (adjset[u].size() > 2) {
      cout << "NO\n";
      return 0;
    } else if (adjset[u].size() <= 1)
      s = u;
  }
  if (s == -1)
    cout << "NO\n";
  else {
    dfs(s, 1);
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << ans[uf.find(i)] << " ";
  }
  return 0;
}
