#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 100;
const int INF = 1e9 + 7;
vector<int> g[N];
int d[N], used[N], x[N], sup[N];
map<pair<int, int>, int> cnt_e;
map<int, int> cnt;
void fail() {
  cout << "NO\n";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; (i) < (m); ++i) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  for (int i = 0; (i) < (n); ++i) d[i] = INF;
  queue<int> q;
  q.push(0);
  d[0] = 0;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int to : g[v]) {
      if (d[to] > d[v] + 1) {
        d[to] = d[v] + 1;
        if (!used[to]) {
          used[to] = 1;
          q.push(to);
        }
      }
    }
  }
  int c = 0;
  for (int v = 0; (v) < (n); ++v)
    if (d[v] == 1) c++;
  for (int v = 0; (v) < (n); ++v) {
    if (d[v] == 1) {
      int cc = 0, cm = 0, bad = 0;
      for (int to : g[v]) {
        if (d[to] == 1) {
          cc++;
        } else if (d[to] > 1)
          bad = 1;
      }
      if (bad) continue;
      if (cc == c - 1) sup[v] = 1;
    }
  }
  for (int v = 0; (v) < (n); ++v) {
    if (d[v] == 1 && !sup[v]) {
      x[v] = 1;
      for (int to : g[v]) {
        if (d[to] == 1 && !sup[to]) {
          x[to] = 1;
        }
      }
      break;
    }
  }
  for (int v = 0; (v) < (n); ++v) {
    if (d[v] == 1 && !x[v] && !sup[v]) {
      x[v] = -1;
    }
  }
  vector<pair<int, int> > vs;
  for (int i = 0; (i) < (n); ++i) {
    vs.push_back(make_pair(d[i], i));
  }
  sort((vs).begin(), (vs).end());
  for (int i = 0; (i) < (n); ++i) {
    int dd = vs[i].first;
    if (dd > 1) {
      int v = vs[i].second;
      for (int to : g[v]) {
        if (d[to] == dd - 1) {
          if (x[to] < 0)
            x[v] = x[to] - 1;
          else
            x[v] = x[to] + 1;
          break;
        }
      }
    }
  }
  for (int i = 0; (i) < (n); ++i) {
    cnt[x[i]]++;
    for (int to : g[i]) {
      if (i < to) cnt_e[make_pair(min(x[i], x[to]), max(x[i], x[to]))]++;
    }
  }
  for (int i = 0; (i) < (n); ++i) {
    for (int to : g[i]) {
      if (abs(x[i] - x[to]) > 1) {
        fail();
      }
    }
  }
  long long sum = 0;
  for (auto p : cnt) {
    int val = p.first, num = p.second;
    if (cnt_e[make_pair(val, val)] != num * 1ll * (num - 1) / 2) fail();
    sum += num * 1ll * (num - 1) / 2;
    int num1 = 0;
    if (cnt.find(val - 1) != cnt.end()) num1 = cnt[val - 1];
    if (cnt_e[make_pair(val - 1, val)] != num * 1ll * num1) fail();
    int num2 = 0;
    if (cnt.find(val + 1) != cnt.end()) num2 = cnt[val + 1];
    if (cnt_e[make_pair(val, val + 1)] != num * 1ll * num2) fail();
    sum += num * 1ll * num2;
  }
  if (sum != m) fail();
  cout << "YES\n";
  int mn = cnt.begin()->first;
  for (int i = 0; (i) < (n); ++i) {
    cout << x[i] - mn + 1 << " ";
  }
  cout << '\n';
  return 0;
}
