#include <bits/stdc++.h>
using namespace std;
int const N = 3e5 + 41;
int const P1 = 41;
int const MOD1 = 1000003241;
int const P2 = 301141;
int const MOD2 = 1000000241;
int n, m, col[N];
vector<int> e[N];
pair<int, int> hashes[N];
int ans[N];
vector<int> p;
vector<int> ecol[N];
int w[N];
set<pair<int, int> > edges;
int cntPass[N];
bool setSign[N];
int sign[N];
void bad() {
  printf("NO\n");
  exit(0);
}
int mul(int a, int b, int mod) { return a * 1LL * b % mod; }
void add(int &a, int b, int mod) {
  a += b;
  if (a >= mod) a -= mod;
}
pair<int, int> getHash(vector<int> &e) {
  pair<int, int> ret = make_pair(0, 0);
  int h1 = 0;
  int h2 = 0;
  int p1 = 1;
  int p2 = 1;
  for (int i = 0; i < (int)(e.size()); ++i) {
    add(h1, mul(p1, e[i], MOD1), MOD1);
    add(h2, mul(p2, e[i], MOD2), MOD2);
    p1 = mul(p1, P1, MOD1);
    p2 = mul(p2, P2, MOD2);
  }
  return make_pair(h1, h2);
}
bool comp(int i, int j) { return hashes[i] < hashes[j]; }
void dfs(int u) {
  w[u] = 1;
  int cntE = 0;
  for (int i = 0; i < (int)(ecol[u].size()); ++i) {
    int to = ecol[u][i];
    if (w[to]) continue;
    if (cntE == 2) bad();
    if (cntE == 1 && setSign[u]) bad();
    if (setSign[u]) {
      setSign[to] = true;
      sign[to] = sign[u];
    } else {
      if (cntE == 0) {
        setSign[to] = true;
        sign[to] = 1;
      } else {
        setSign[to] = true;
        sign[to] = -1;
      }
    }
    ans[to] = ans[u] + sign[to];
    dfs(to);
    ++cntE;
  }
}
void check() {
  for (int i = 0; i < n; ++i) {
    int curAns = ans[col[i]];
    for (int j = 0; j < (int)(e[i].size()); ++j) {
      int toAns = ans[col[e[i][j]]];
      if (abs(curAns - toAns) > 1) {
        bad();
      }
    }
  }
}
void solve() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    --u;
    --v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  for (int i = 0; i < n; ++i) {
    e[i].push_back(i);
    sort(e[i].begin(), e[i].end());
    hashes[i] = getHash(e[i]);
  }
  for (int i = 0; i < n; ++i) p.push_back(i);
  sort(p.begin(), p.end(), comp);
  for (int i = 0; i < n; ++i) {
    if (i > 0 && hashes[p[i]] == hashes[p[i - 1]]) {
      col[p[i]] = col[p[i - 1]];
    } else {
      col[p[i]] = p[i];
    }
  }
  for (int i = 0; i < n; ++i) {
    int curCol = col[i];
    for (int j = 0; j < (int)(e[i].size()); ++j) {
      int toCol = col[e[i][j]];
      if (toCol != curCol) {
        ecol[curCol].push_back(toCol);
      }
    }
  }
  for (int i = 0; i < n; ++i) ans[i] = 1;
  for (int i = 0; i < n; ++i) {
    if (!w[col[i]]) {
      dfs(col[i]);
    }
  }
  check();
  int mini = MOD1;
  for (int i = 0; i < n; ++i) mini = min(mini, ans[col[i]]);
  printf("YES\n");
  for (int i = 0; i < n; ++i) printf("%d ", ans[col[i]] - mini + 1);
}
int main() {
  solve();
  return 0;
}
