#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 5;
const int oo = (int)1e9 + 7;
int n, m, col[N];
long long h[N], pw[N], cnt[N];
bool vis[N], used[2 * N + 5];
vector<int> g[N];
void dfs(int u) {
  vis[u] = true;
  for (int v : g[u])
    if (h[v] == h[u]) col[v] = col[u];
  for (int v : g[u])
    if (!vis[v]) {
      if (!col[v]) {
        for (int j = col[u] - 1; j <= col[u] + 1; ++j)
          if (!used[j]) {
            col[v] = j, used[j] = true;
            break;
          }
      }
      if (col[v])
        dfs(v);
      else {
        puts("NO");
        exit(0);
      }
    }
}
int main() {
  scanf("%d%d", &n, &m);
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) h[i] = pw[i] = pw[i - 1] * 3ll;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
    h[u] += pw[v], h[v] += pw[u];
  }
  col[1] = n + 1, used[n + 1] = true;
  dfs(1);
  int mn = *min_element(col + 1, col + n + 1);
  if (!mn) {
    puts("NO");
    return 0;
  }
  for (int u = 1; u <= n; ++u)
    for (int v : g[u])
      if (abs(col[v] - col[u]) > 1) {
        puts("NO");
        return 0;
      }
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%d ", col[i]);
  return 0;
}
