#include <bits/stdc++.h>
using namespace std;
vector<long long> V[300100];
pair<long long, long long> H[300100], I[300100], D[300100];
long long N, M, C[300100];
queue<long long> Q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M;
  for (int x, y; M--;) {
    cin >> x >> y;
    V[x].push_back(y);
    V[y].push_back(x);
  }
  for (int i = 1; i <= N; i++) {
    V[i].push_back(i);
    sort(V[i].begin(), V[i].end());
    for (auto j : V[i])
      H[i] = {(H[i].first * 317 + j) % 1000000007,
              (H[i].second * 213 + j) % 1000013};
  }
  C[1] = 50000000;
  Q.push(1);
  while (!Q.empty()) {
    long long x = Q.front();
    Q.pop();
    for (auto y : V[x])
      if (C[y]) {
        if (C[x] == C[y]) {
          if (H[x] != H[y]) return cout << "NO", 0;
        } else if (C[x] == C[y] - 1) {
          if (I[x] != make_pair(0LL, 0LL) && I[x] != H[y] ||
              D[y] != make_pair(0LL, 0LL) && D[y] != H[x])
            return cout << "NO", 0;
          I[x] = H[y];
          D[y] = H[x];
        } else if (C[x] == C[y] + 1) {
          if (D[x] != make_pair(0LL, 0LL) && D[x] != H[y] ||
              I[y] != make_pair(0LL, 0LL) && I[y] != H[x])
            return cout << "NO", 0;
          D[x] = H[y];
          I[y] = H[x];
        } else
          return cout << "NO", 0;
      } else {
        Q.push(y);
        if (H[y] == H[x])
          C[y] = C[x];
        else if (H[y] != H[x]) {
          if (I[x] == H[y] || I[x] == make_pair(0LL, 0LL))
            C[y] = C[x] + 1, I[x] = H[y], D[y] = H[x];
          else if (D[x] == H[y] || D[x] == make_pair(0LL, 0LL))
            C[y] = C[x] - 1, D[x] = H[y], I[y] = H[x];
          else
            return cout << "NO", 0;
        }
      }
  }
  cout << "YES\n";
  for (int i = 1; i <= N; i++) cout << C[i] << ' ';
}
