#include <bits/stdc++.h>
using namespace std;
int a, s, d[300002], f[300002], fx[300002], ff[300002], g, h, j, k, l, i, n, m;
vector<int> v[300002];
void dfs(int idx, int up, int dw, int par) {
  fx[idx] = 1;
  for (auto it : v[idx]) {
    if (d[it] == d[par]) continue;
    if (f[d[it]] == f[d[idx]] + 1 || f[d[it]] == f[d[idx]] - 1 ||
        f[d[it]] == f[d[idx]])
      continue;
    if (!up) {
      up = 1;
      if (f[d[it]] && f[d[it]] != f[d[idx]] + 1) {
        cout << "NO";
        g = 1;
        return;
      }
      f[d[it]] = f[d[idx]] + 1;
    } else {
      if (!dw) {
        dw = 1;
        if (f[d[it]] && f[d[it]] != f[d[idx]] - 1) {
          cout << "NO";
          g = 1;
          return;
        }
        f[d[it]] = f[d[idx]] - 1;
      } else {
        cout << "NO";
        g = 1;
        return;
      }
    }
  }
  for (auto it : v[idx]) {
    if (d[it] != d[idx] && !fx[it]) {
      if (f[d[it]] == f[d[idx]] + 1)
        dfs(it, 0, 1, idx);
      else
        dfs(it, 1, 0, idx);
      if (g == 1) return;
    }
  }
}
int gpar(int i) {
  if (d[i] == i)
    return i;
  else
    return d[i] = gpar(d[i]);
}
int cmp(int i1, int i2) {
  int c1 = 0, I1 = 0, I2 = 0;
  if (v[i1].size() != v[i2].size()) return 0;
  if (v[i1][I1] == i2) {
    c1 = 1;
    I1++;
  }
  if (v[i2][I2] == i1) {
    I2++;
  }
  for (int i = 0; i < v[i1].size() - 1; i++) {
    if (v[i1][I1] != v[i2][I2]) {
      return 0;
    }
    I1++;
    I2++;
    if (v[i1][I1] == i2) {
      c1 = 1;
      I1++;
    }
    if (v[i2][I2] == i1) {
      I2++;
    }
  }
  return c1;
}
void df1(int idx) {
  ff[idx] = 1;
  for (auto it : v[idx]) {
    if (gpar(idx) != gpar(it)) {
      if (cmp(it, idx)) {
        d[d[idx]] = d[it];
      }
      if (!ff[it]) df1(it);
    }
  }
}
int main() {
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    scanf("%d%d", &a, &s);
    v[a].push_back(s);
    v[s].push_back(a);
  }
  for (i = 1; i <= n; i++) {
    sort(v[i].begin(), v[i].end());
    d[i] = i;
  }
  df1(1);
  for (i = 1; i <= n; i++) {
  }
  f[d[1]] = 10 * n;
  dfs(1, 0, 0, 0);
  if (g) return 0;
  cout << "YES\n";
  for (i = 1; i <= n; i++) {
    cout << f[d[i]] << " ";
  }
}
