#include <bits/stdc++.h>
using namespace std;
int readint() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
const int maxn = 300005;
int n, m, start;
int u[maxn], v[maxn], f[maxn], col[maxn], vis[maxn];
vector<int> edge[maxn];
int Find(int x) { return f[x] == x ? x : f[x] = Find(f[x]); }
void Union(int x, int y) {
  x = Find(x);
  y = Find(y);
  if (x != y) f[x] = y;
}
bool equal(int x, int y) {
  int px = 0, py = 0;
  if (edge[x].size() != edge[y].size()) return false;
  while (px < edge[x].size() && py < edge[x].size()) {
    if (edge[x][px] == y) px++;
    if (edge[y][py] == x) py++;
    if (px == edge[x].size() || py == edge[y].size()) break;
    if (edge[x][px] != edge[y][py]) return false;
    px++;
    py++;
  }
  return true;
}
bool dfs(int x, int from) {
  if (vis[x]) return false;
  vis[x] = true;
  vector<int> can;
  can.clear();
  for (int(i) = 0; (i) < edge[x].size(); i++) {
    int y = Find(edge[x][i]);
    if (y != x) can.push_back(y);
  }
  sort(can.begin(), can.end());
  can.resize(unique(can.begin(), can.end()) - can.begin());
  if (can.size() > 2) return false;
  for (int(i) = 0; (i) < can.size(); i++)
    if (can[i] != from) return dfs(can[i], x);
  start = x;
  return true;
}
void dfs_color(int x, int from, int color) {
  col[x] = color;
  for (int(i) = 0; (i) < edge[x].size(); i++) {
    int y = Find(edge[x][i]);
    if (y != from && y != x) {
      dfs_color(y, x, color + 1);
      return;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = 1; (i) <= n; i++) f[i] = i;
  for (int(i) = 0; (i) < m; i++) {
    scanf("%d%d", &u[i], &v[i]);
    edge[u[i]].push_back(v[i]);
    edge[v[i]].push_back(u[i]);
  }
  for (int(i) = 1; (i) <= n; i++) sort(edge[i].begin(), edge[i].end());
  for (int(i) = 0; (i) < m; i++)
    if (equal(u[i], v[i])) Union(u[i], v[i]);
  if (!dfs(Find(1), -1)) {
    printf("NO");
    return 0;
  }
  dfs_color(start, -1, 1);
  for (int(i) = 1; (i) <= n; i++)
    if (col[Find(i)] == 0) {
      printf("NO");
      return 0;
    }
  printf("YES\n");
  for (int(i) = 1; (i) <= n; i++) printf("%d ", col[Find(i)]);
  return 0;
}
