#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
long long bt[maxn];
long long d[maxn];
map<long long, int> has;
pair<int, int> edg[maxn];
int f[maxn];
int id[maxn];
int lab[maxn];
vector<int> e[maxn];
int getf(int x) {
  if (x == f[x])
    return x;
  else
    return f[x] = getf(f[x]);
}
void dfs(int x, int y, int de) {
  int i;
  lab[x] = de;
  for (i = 0; i < (int)e[x].size(); i++) {
    if (e[x][i] == y) continue;
    dfs(e[x][i], x, de + 1);
  }
}
int main() {
  int i, j, n, m;
  cin >> n >> m;
  int x, y;
  bt[0] = 1;
  for (int i = 1; i <= n; i++) {
    bt[i] = 3 * bt[i - 1];
    d[i] = bt[i];
  }
  for (i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    edg[i] = make_pair(x, y);
    d[x] += bt[y], d[y] += bt[x];
  }
  j = 1;
  for (i = 1; i <= n; i++) {
    if (!has[d[i]]) has[d[i]] = j++;
    id[i] = has[d[i]];
    f[i] = i;
  }
  for (i = 0; i < m; i++) {
    x = id[edg[i].first], y = id[edg[i].second];
    if (x == y) continue;
    for (j = 0; j < (int)e[x].size(); j++) {
      if (e[x][j] == y) break;
    }
    if (j >= 2) {
      return 0 * printf("NO\n");
    }
    if (j == (int)e[x].size())
      e[x].push_back(y);
    else
      continue;
    for (j = 0; j < (int)e[y].size(); j++) {
      if (e[y][j] == x) break;
    }
    if (j >= 2) {
      return 0 * printf("NO\n");
    }
    if (j == (int)e[y].size())
      e[y].push_back(x);
    else
      continue;
    if (getf(x) == getf(y)) {
      return 0 * printf("NO\n");
    } else
      f[getf(y)] = f[getf(x)];
  }
  for (i = 1; i <= n; i++) {
    if ((int)e[id[i]].size() < 2) {
      dfs(id[i], -1, 1);
    }
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) printf(i == n ? "%d\n" : "%d ", lab[id[i]]);
}
