#include <bits/stdc++.h>
using namespace std;
const int MXN = 3 * 1e5 + 5;
int n, m;
pair<int, set<int> > g[MXN];
pair<int, int> edg[MXN];
int grp[MXN];
int vis[MXN];
int label[MXN];
set<int> g2[MXN];
bool sort_fn(pair<int, set<int> >& p1, pair<int, set<int> >& p2) {
  return p1.second < p2.second;
}
void solve(int u, int pa = -1, int c = 1) {
  label[u] = c;
  for (int v : g2[u]) {
    if (v == pa) continue;
    solve(v, u, c + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    g[i].first = i;
    g[i].second.insert(i);
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].second.insert(v);
    g[v].second.insert(u);
    edg[i] = make_pair(u, v);
  }
  sort(g + 1, g + n + 1, sort_fn);
  int cnt = 1;
  grp[g[1].first] = cnt;
  for (int i = 2; i <= n; i++) {
    int vid = g[i].first;
    if (g[i].second != g[i - 1].second) cnt++;
    grp[vid] = cnt;
  }
  for (int i = 1; i <= m; i++) {
    int u = edg[i].first;
    int v = edg[i].second;
    int gu = grp[u];
    int gv = grp[v];
    if (gu != gv) {
      g2[gu].insert(gv);
      g2[gv].insert(gu);
    }
    if (g2[gu].size() > 2 || g2[gv].size() > 2) {
      cout << "NO\n";
      exit(0);
    }
  }
  bool flag = false;
  for (int i = 1; i <= cnt; i++) {
    if (g2[i].size() <= 1) {
      solve(i);
      flag = true;
    }
  }
  if (!flag) {
    cout << "NO\n";
    exit(0);
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << label[grp[i]] << " ";
  cout << endl;
  return 0;
}
