#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\t';
  err(++it, args...);
}
const int NN = (int)3e5 + 10;
pair<vector<int>, int> adj[NN];
int lab[NN], to[NN], VAL[NN];
bool vis[NN], is = 1;
bool cmp(pair<vector<int>, int> u, pair<vector<int>, int> v) {
  return u.first < v.first;
}
vector<int> _ad[NN];
set<pair<int, int> > M;
void dfs(int x, int prev) {
  vis[x] = 1;
  for (auto u : _ad[x]) {
    if (u != prev) {
      if (vis[u])
        is = 0;
      else
        dfs(u, x);
    }
  }
}
void dfs2(int u, int p, int v) {
  VAL[u] = v;
  for (auto x : _ad[u]) {
    if (x != p) {
      dfs2(x, u, v + 1);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, i, j, k, U = 0, m;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].first.push_back(v);
    adj[v].first.push_back(u);
  }
  for (i = 1; i < n + 1; i++) {
    adj[i].first.push_back(i);
    adj[i].second = i;
    sort(adj[i].first.begin(), adj[i].first.end());
  }
  sort(adj + 1, adj + n + 1, cmp);
  for (i = 1; i <= n;) {
    for (j = i + 1; j <= n; j++) {
      if (adj[j].first.size() != adj[i].first.size()) break;
      bool eq = 1;
      for (int it = 0; it < adj[j].first.size(); it++) {
        if (adj[j].first[it] != adj[i].first[it]) {
          eq = 0;
          break;
        }
      }
      if (!eq) {
        break;
      }
    }
    ++U;
    for (k = i; k < j; k++) {
      to[adj[k].second] = U;
    }
    i = j;
  }
  for (i = 1; i <= n; i++) {
    for (auto v : adj[i].first) {
      if (to[v] != to[adj[i].second] &&
          M.find({to[v], to[adj[i].second]}) == M.end()) {
        M.insert({to[v], to[adj[i].second]});
        M.insert({to[adj[i].second], to[v]});
        _ad[to[v]].push_back(to[adj[i].second]);
        _ad[to[adj[i].second]].push_back(to[v]);
      }
    }
  }
  is = 1;
  for (i = 1; i <= U; i++) {
    if (_ad[i].size() > 2) is = 0;
  }
  if (is) {
    dfs(1, 0);
    if (is) {
      for (i = 1; i <= U; i++) {
        if (_ad[i].size() < 2) {
          dfs2(i, 0, 10);
          cout << "YES\n";
          for (i = 1; i <= n; i++) {
            cout << (VAL[to[i]]) << " ";
          }
          return 0;
        }
      }
    } else
      cout << "NO";
  } else
    cout << "NO";
  return 0;
}
