#include <bits/stdc++.h>
using namespace std;
void read(int& x) { scanf("%d", &x); }
void read(long long& x) { scanf("%lld", &x); }
template <typename T, typename... Args>
void read(T& a, Args&... b) {
  read(a);
  read(b...);
}
int n, z;
vector<int> e[300010];
map<vector<int>, int> m;
int par[300010];
int root(int first) {
  return (first == par[first]) ? first : (par[first] = root(par[first]));
}
vector<int> f[300010];
int cn;
int col[300010];
vector<int> g[300010];
int main() {
  read(n, z);
  for (int i = 1; i <= z; ++i) {
    int a, b;
    read(a, b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  for (int i = 1; i <= n; ++i) par[i] = i;
  for (int i = 1; i <= n; ++i) {
    e[i].push_back(i);
    sort((e[i]).begin(), (e[i]).end());
    int& r = m[e[i]];
    if (r) par[root(r)] = root(i);
    r = root(i);
  }
  for (int i = 1; i <= n; ++i)
    for (int j : e[i])
      if (root(i) != root(j)) {
        f[root(i)].emplace_back(root(j));
        f[root(j)].emplace_back(root(i));
      }
  int hashi = -1;
  for (int i = 1; i <= n; ++i)
    if (i == par[i]) {
      int c[2] = {-1, -1};
      for (int j : f[i]) {
        if (c[0] == -1)
          c[0] = j;
        else if (c[0] != j) {
          if (c[1] != j && c[1] != -1) {
            puts("NO");
            return 0;
          } else
            c[1] = j;
        }
      }
      if (c[0] != -1) g[i].push_back(c[0]);
      if (c[1] == -1)
        hashi = i;
      else
        g[i].push_back(c[1]);
    }
  if (hashi == -1) {
    puts("NO");
    return 0;
  }
  int p = hashi;
  for (bool f = 1; f;) {
    col[p] = ++cn;
    f = 0;
    for (int second : g[p]) {
      if (!col[second]) {
        p = second;
        f = 1;
        break;
      }
    }
  }
  for (int i = 1; i <= n; ++i)
    if ((i == par[i]) && (!col[i])) {
      puts("NO");
      return 0;
    }
  puts("YES");
  for (int i = 1; i <= n; ++i) {
    printf("%d ", col[root(i)]);
  }
  return 0;
}
