#include <bits/stdc++.h>
using namespace std;
map<vector<int>, int> hasher;
int get_hash(vector<int> a) {
  if (hasher[a] == 0) hasher[a] = hasher.size();
  return hasher[a];
}
void dfs(int start, int color, vector<int>& colors, vector<set<int>>& ne) {
  colors[start] = color;
  for (auto i : ne[start]) {
    if (colors[i] == -1) {
      dfs(i, color + 1, colors, ne);
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<vector<int>> d(n);
  for (int i = 0; i < m; ++i) {
    int from, to;
    scanf("%d%d", &from, &to);
    d[from - 1].push_back(to - 1);
    d[to - 1].push_back(from - 1);
  }
  vector<int> mp(n);
  vector<int> hashes(n);
  for (int i = 0; i < n; ++i) {
    d[i].push_back(i);
    sort(d[i].begin(), d[i].end());
    hashes[i] = get_hash(d[i]);
    mp[i] = i;
  }
  for (int i = 0; i < n; ++i) {
    for (size_t j = 0; j < d[i].size(); ++j) {
      auto to = d[i][j];
      if (hashes[to] == hashes[i]) {
        if (i < to) {
          mp[to] = mp[i];
        } else {
          mp[i] = mp[to];
        }
      }
    }
  }
  int cnt = 0;
  int maxi = -1;
  for (int i = 0; i < n; ++i) {
    maxi = max(maxi, mp[i]);
  }
  ++maxi;
  vector<set<int>> ne(maxi);
  vector<int> colors(maxi, -1);
  for (int i = 0; i < n; ++i) {
    for (size_t j = 0; j < d[i].size(); ++j) {
      auto to = d[i][j];
      if (mp[to] != mp[i]) {
        ne[mp[to]].insert(mp[i]);
        ne[mp[i]].insert(mp[to]);
      }
    }
  }
  bool flag = true;
  for (int i = 0; i < maxi; ++i) {
    cnt += ne[i].size();
    if (ne[i].size() > 2) {
      flag = false;
    }
  }
  if (!flag) {
    printf("NO\n");
    return 0;
  }
  int start = -1;
  for (int i = 0; i < maxi; ++i) {
    if (ne[i].size() == 1 || ne.size() == 1) {
      colors[i] = 1;
      start = i;
      break;
    }
  }
  dfs(start, 1, colors, ne);
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    if (colors[mp[i]] < 0) {
      return 1;
    }
    printf("%d ", colors[mp[i]]);
  }
  printf("\n");
  return 0;
}
