#include <bits/stdc++.h>
using namespace std;
vector<int> vec[300005];
vector<int> edges[300005];
int col[300005];
int root[300005];
int num[300005];
bool cmp(int x1, int x2) { return vec[x1] < vec[x2]; }
void dfs(int fa, int now, int color) {
  col[now] = color;
  for (int i = 0; i < edges[now].size(); i++) {
    if (edges[now][i] != fa) dfs(now, edges[now][i], color + 1);
  }
  return;
}
int main() {
  bool flag = 0;
  int s;
  int n, m;
  int u, v;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    vec[i].push_back(i);
    num[i] = i;
    root[i] = i;
    sort(vec[i].begin(), vec[i].end());
  }
  sort(num + 1, num + n + 1, cmp);
  for (int i = 2; i <= n; i++)
    if (vec[num[i]] == vec[num[i - 1]]) root[num[i]] = root[num[i - 1]];
  s = root[1];
  for (int i = 1; i <= n; i++) {
    if (root[i] == i) {
      for (int j = 0; j < vec[i].size(); j++)
        if (vec[i][j] != i && vec[i][j] == root[vec[i][j]])
          edges[i].push_back(vec[i][j]);
      if (edges[i].size() > 2) flag = 1;
      if (edges[i].size() == 1) s = i;
    }
  }
  if (flag)
    printf("NO\n");
  else {
    printf("YES\n");
    dfs(-1, s, 1);
    for (int i = 1; i <= n; i++) printf("%d ", col[root[i]]);
    printf("\n");
  }
  return 0;
}
