#include <bits/stdc++.h>
using namespace std;
const long long mod[2] = {1000000097, 1000000033};
vector<vector<int> > G;
vector<pair<long long, long long> > hashes;
vector<long long> powers[2];
map<pair<long long, long long>, int> res;
bool dfs(int x, int sum) {
  bool valid = true;
  set<pair<long long, long long> > hav;
  for (int i = 0; i < G[x].size(); ++i) {
    int j = G[x][i];
    if (hashes[x] != hashes[j]) hav.insert(hashes[j]);
    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);
      }
    }
  }
  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<pair<long long, long long> >(n);
  powers[0] = vector<long long>(n, 1);
  powers[1] = vector<long long>(n, 1);
  hashes[0] = {powers[0][0], powers[1][0]};
  for (int i = 1; i < n; ++i) {
    powers[0][i] = (powers[0][i - 1] << 1) % mod[0];
    powers[1][i] = (powers[1][i - 1] << 1) % mod[1];
    hashes[i] = {powers[0][i], powers[1][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].first = (hashes[x].first + powers[0][y]) % mod[0];
    hashes[y].first = (hashes[y].first + powers[0][x]) % mod[0];
    hashes[x].second = (hashes[x].second + powers[1][y]) % mod[1];
    hashes[y].second = (hashes[y].second + powers[1][x]) % mod[1];
  }
  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;
}
