#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = 300011;
int n, m;
vector<int> gr[N], ngr[N];
int compNo[N];
bool eq;
int deg[N], ans[N];
bool comp(const vector<int>& A, const vector<int>& B) {
  auto ita = A.begin();
  auto itb = B.begin();
  while (ita != (--A.end()) and itb != (--B.end())) {
    if (*ita > *itb)
      return 0;
    else if (*ita < *itb)
      return 1;
    ita++, itb++;
  }
  if (ita != (--A.end()))
    return 0;
  else if (itb != (--B.end()))
    return 1;
  return eq = 0;
}
void dfs(int v, int p) {
  for (auto u : ngr[v]) {
    if (u == p) continue;
    ans[u] = ans[v] - 1;
    dfs(u, v);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i) {
    gr[i].push_back(i);
    sort(gr[i].begin(), gr[i].end());
    gr[i].push_back(i);
  }
  sort(gr + 1, gr + n + 1, comp);
  int numComp = 1;
  compNo[gr[1].back()] = numComp;
  for (int i = 2; i <= n; ++i) {
    int u = gr[i - 1].back();
    int v = gr[i].back();
    eq = 1;
    comp(gr[i - 1], gr[i]);
    if (!eq)
      compNo[v] = compNo[u];
    else
      compNo[v] = ++numComp;
  }
  set<pair<int, int> > s;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < (int)(gr[i].size()) - 1; ++j) {
      int u = compNo[gr[i].back()], v = compNo[gr[i][j]];
      if (u < v) swap(u, v);
      if (u != v and s.find(make_pair(u, v)) == s.end()) {
        s.insert(make_pair(u, v));
        ngr[u].push_back(v), ngr[v].push_back(u);
        deg[u]++, deg[v]++;
      }
    }
  }
  bool ok = 1;
  int start = 1;
  for (int i = 1; i <= numComp; ++i) {
    if (deg[i] >= 3) ok = 0;
    if (deg[i] == 1) start = i;
  }
  if (!ok) return 0 * printf("NO\n");
  ans[start] = 1e9;
  dfs(start, 0);
  printf("YES\n");
  for (int i = 1; i <= n; ++i) {
    printf("%d ", ans[compNo[i]]);
  }
  return 0;
}
