#include <bits/stdc++.h>
using namespace std;
int color[300009];
int ans[300009];
vector<int> graph[300009];
pair<vector<int>, int> vv[300009];
bool dfs(int i, int b, int c) {
  map<int, int> m;
  map<int, int> m1;
  for (int f = 0; f < graph[i].size(); f++) {
    if (color[graph[i][f]] == color[i])
      ans[graph[i][f]] = c;
    else if (ans[graph[i][f]] == 0) {
      m[color[graph[i][f]]] = graph[i][f];
      if (m1.find(color[graph[i][f]]) == m1.end()) {
        m1[color[graph[i][f]]] = m.size();
      }
    }
  }
  if (m.size() > 2 || m.size() > 1 && b) return 0;
  int bb[2];
  bb[0] = b;
  if (b == 0) bb[0] = 1;
  bb[1] = -bb[0];
  for (int f = 0; f < graph[i].size(); f++) {
    if (!ans[graph[i][f]] && m1[color[graph[i][f]]]) {
      ans[graph[i][f]] = c + bb[m1[color[graph[i][f]]] - 1];
    }
  }
  bool ret = 1;
  for (auto it = m.begin(); it != m.end(); it++) {
    ret &= dfs(it->second, bb[m1[it->first] - 1], c + bb[m1[it->first] - 1]);
  }
  return ret;
}
int main() {
  int n, m, a, b;
  scanf("%d %d", &n, &m);
  for (int f = 0; f < m; f++) {
    scanf("%d %d", &a, &b);
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  for (int f = 1; f <= n; f++) {
    graph[f].push_back(f);
    vv[f] = {graph[f], f};
    sort(vv[f].first.begin(), vv[f].first.end());
  }
  sort(vv + 1, vv + n + 1);
  int cc = 0;
  for (int f = 1; f <= n; f++) {
    if (vv[f].first != vv[f - 1].first) cc++;
    color[vv[f].second] = cc;
  }
  bool ret = dfs(1, 0, 1000000);
  for (int f = 1; f <= n; f++) {
    for (int f1 = 0; f1 < graph[f].size(); f1++)
      if (abs(ans[graph[f][f1]] - ans[f]) > 1) ret = 0;
  }
  if (!ret)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int f = 1; f <= n; f++) printf("%d ", ans[f]);
    printf("\n");
  }
}
