#include <bits/stdc++.h>
using namespace std;
const int N = 600010, MaxCH = 20000000;
int n, m, pos, len;
char CH[MaxCH];
vector<int> G[N];
int fa[N], color[N], Hash[N], h[N], u[N], v[N], used[N], vis[N];
inline int read() {
  int x = 0;
  while (CH[pos] < '0' || CH[pos] > '9') ++pos;
  while (CH[pos] >= '0' && CH[pos] <= '9') x = x * 10 + CH[pos++] - '0';
  return x;
}
namespace dsu {
inline int find(int x) { return x == fa[x] ? x : find(fa[x]); }
inline void connect(int x, int y) {
  int u = find(x), v = find(y);
  if (u == v) return;
  fa[u] = v;
}
}  // namespace dsu
using namespace dsu;
void build() {
  for (int i = 1; i <= m; ++i)
    if (h[u[i]] == h[v[i]]) connect(u[i], v[i]);
  for (int i = 1; i <= m; ++i) {
    int x = find(u[i]), y = find(v[i]);
    if (x == y) continue;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) {
    sort(G[i].begin(), G[i].end());
    G[i].erase(unique(G[i].begin(), G[i].end()), G[i].end());
    if (G[i].size() > 2) {
      puts("NO");
      exit(0);
    }
  }
}
void dfs(int u, int last) {
  used[color[u]] = 1;
  vis[u] = 1;
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    if (v == last) continue;
    if (vis[v]) {
      puts("NO");
      exit(0);
    }
    if (!used[color[u] - 1])
      color[v] = color[u] - 1;
    else
      color[v] = color[u] + 1;
    used[color[v]] = 1;
    dfs(v, u);
  }
}
int main() {
  len = fread(CH, 1, MaxCH, stdin);
  CH[len] = ' ';
  n = read();
  m = read();
  Hash[0] = 1;
  for (int i = 1; i <= n; ++i)
    Hash[i] = Hash[i - 1] * 123333, fa[i] = i, h[i] = Hash[i];
  for (int i = 1; i <= m; ++i) {
    u[i] = read();
    v[i] = read();
    h[u[i]] += Hash[v[i]];
    h[v[i]] += Hash[u[i]];
  }
  build();
  color[find(1)] = 300000;
  dfs(find(1), 0);
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%d ", color[find(i)]);
  return 0;
}
