#include <bits/stdc++.h>
using namespace std;
const long long p = 31, q = 13;
vector<vector<int> > G;
vector<long long> hashes;
vector<long long> powers;
unordered_map<long long, int> res(1e6);
bool dfs(int x, int sum) {
  bool valid = true;
  set<long long> hav;
  for (int i = 0; i < G[x].size(); ++i) {
    int j = G[x][i];
    if (!res.count(hashes[j])) {
      if (sum != 0) {
        res[hashes[j]] = res[hashes[x]] + sum;
        valid &= dfs(j, sum);
      } else {
        int asum = (hav.size() == 1 ? 1 : -1);
        res[hashes[j]] = res[hashes[x]] + asum;
        valid &= dfs(j, asum);
      }
    }
    if (hashes[x] != hashes[j]) {
      if (abs(res[hashes[x]] - res[hashes[j]]) <= 1)
        hav.insert(hashes[j]);
      else
        return 0;
    }
  }
  return valid and hav.size() <= 2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  G = vector<vector<int> >(n);
  hashes = vector<long long>(n, 0);
  powers = vector<long long>(n, 1);
  hashes[0] = powers[0];
  for (int i = 1; i < n; ++i) {
    powers[i] = p * powers[i - 1] + q;
    hashes[i] = powers[i];
  }
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    G[x].push_back(y);
    G[y].push_back(x);
    hashes[x] = (hashes[x] + powers[y]);
    hashes[y] = (hashes[y] + powers[x]);
  }
  res[hashes[0]] = 1e6;
  if (dfs(0, 0)) {
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) cout << res[hashes[i]] << " ";
    cout << endl;
  } else
    cout << "NO" << endl;
}
