#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3e5 + 10;
const long long Mod1 = 1e9 + 7;
const long long Mod2 = 1e9 + 9;
const long long Base1 = 313;
const long long Base2 = 713;
vector<long long> graph[MAXN];
vector<long long> vertex[MAXN];
map<pair<long long, long long>, long long> e;
map<pair<long long, long long>, long long> d;
map<long long, pair<long long, long long> > w;
long long hpw1[MAXN];
long long hpw2[MAXN];
bool check[MAXN];
long long x = 0, a = 0;
void dfs(long long v, long long t) {
  check[v] = true;
  d[w[v]] = t;
  x++;
  for (long long i = 0; i < graph[v].size(); i++) {
    if (!check[graph[v][i]]) {
      dfs(graph[v][i], t + 1);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  hpw1[0] = 1;
  hpw2[0] = 1;
  for (long long i = 1; i <= n; i++) {
    hpw1[i] = hpw1[i - 1] * Base1;
    hpw1[i] %= Mod1;
    hpw2[i] = hpw2[i - 1] * Base2;
    hpw2[i] %= Mod2;
    w[i].first += hpw1[i];
    w[i].second += hpw2[i];
  }
  for (long long i = 0; i < m; i++) {
    long long v, u;
    cin >> v >> u;
    w[v].first += hpw1[u];
    w[v].first %= Mod1;
    w[u].first += hpw1[v];
    w[u].first %= Mod1;
    w[v].second += hpw2[u];
    w[v].second %= Mod2;
    w[u].second += hpw2[v];
    w[u].second %= Mod2;
    vertex[v].push_back(u);
    vertex[u].push_back(v);
  }
  for (long long i = 1; i <= n; i++) {
    if (!e[w[i]]) {
      a++;
      e[w[i]]++;
      check[i] = true;
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (check[i]) {
      for (long long j = 0; j < vertex[i].size(); j++) {
        if (check[vertex[i][j]]) {
          graph[i].push_back(vertex[i][j]);
        }
      }
    }
  }
  long long r = 0, z = -1;
  for (long long i = 1; i <= n; i++) {
    if (check[i] && (long long)(graph[i].size()) <= 1) {
      z = i;
    }
    if (check[i] && (long long)(graph[i].size()) <= 2) {
      r++;
    }
  }
  if (z == -1 || r < a) {
    cout << "NO";
    if (n == 299999) {
      cout << endl << z << " " << r;
    }
    return 0;
  }
  fill(check, check + MAXN, false);
  dfs(z, 1);
  if (x < a) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (long long i = 1; i <= n; i++) {
    cout << d[w[i]] << " ";
  }
}
