#include <bits/stdc++.h>
using namespace std;
int n, m, a[300300], b[300300], ans[300300];
int C, col[300300];
int T, vis[300300];
vector<int> adj[300300], v[300300];
int vcnt;
long long ecnt;
bool similar(int x, int y) {
  if (adj[x].size() != adj[y].size()) return 0;
  int sz = adj[x].size();
  int i = 0, j = 0;
  while (i < sz && j < sz) {
    if (adj[x][i] == y) i++;
    if (adj[y][j] == x) j++;
    if (i == sz || j == sz) break;
    if (adj[x][i] != adj[y][j]) return 0;
    i++, j++;
  }
  return 1;
}
void dfs(int x) {
  col[x] = C;
  vcnt++;
  ecnt += v[x].size();
  for (int i = 0; i < v[x].size(); i++) {
    int y = v[x][i];
    if (!col[y]) dfs(y);
  }
}
void add(int x, int y) {
  if (x == y) return;
  for (int i = 0; i < v[x].size(); i++) {
    if (v[x][i] == y) return;
  }
  v[x].push_back(y);
  if (v[x].size() >= 3) puts("NO"), exit(0);
}
void DFS(int x) {
  vis[x] = ++T;
  for (int i = 0; i < v[x].size(); i++) {
    int y = v[x][i];
    if (!vis[y]) DFS(y);
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
    a[i] = x, b[i] = y;
  }
  for (int i = 1; i <= n; i++) sort(adj[i].begin(), adj[i].end());
  for (int i = 1; i <= m; i++) {
    int x = a[i], y = b[i];
    if (similar(x, y)) v[x].push_back(y), v[y].push_back(x);
  }
  for (int i = 1; i <= n; i++)
    if (!col[i]) {
      vcnt = 0, ecnt = 0;
      C++, dfs(i);
      if (ecnt != 1ll * vcnt * (vcnt - 1)) return puts("NO"), 0;
    }
  for (int i = 1; i <= C; i++) v[i].clear();
  for (int i = 1; i <= m; i++) {
    int x = a[i], y = b[i];
    add(col[x], col[y]), add(col[y], col[x]);
  }
  for (int i = 1; i <= C; i++) {
    if (!vis[i] && v[i].size() <= 1) DFS(i);
  }
  for (int i = 1; i <= C; i++)
    if (!vis[i]) return puts("NO"), 0;
  for (int i = 1; i <= n; i++) ans[i] = vis[col[i]];
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%d%c", ans[i], i < n ? ' ' : '\n');
  return 0;
}
