#include <bits/stdc++.h>
using namespace ::std;
const long long maxn = 3e5 + 500;
const long long mod = 1e9 + 7;
const long long mod2 = 1e9 + 9;
const long long inf = 1e9 + 500;
long long poww1(long long a, long long b) {
  if (b == 0) return 1;
  long long v = poww1(a, b / 2);
  v = (v * v) % mod;
  if (b & 1) {
    return (v * a) % mod;
  }
  return v;
}
long long poww2(long long a, long long b) {
  if (b == 0) return 1;
  long long v = poww2(a, b / 2);
  v = (v * v) % mod2;
  if (b & 1) {
    return (v * a) % mod2;
  }
  return v;
}
vector<long long> ger[maxn];
long long hash1[maxn];
long long hash2[maxn];
long long moa[maxn];
long long cc[maxn];
long long h[maxn];
pair<pair<long long, long long>, long long> t[maxn];
set<long long> gerrrst[maxn];
vector<long long> gerrr[maxn];
bool vis[maxn];
vector<long long> topol;
long long koj[maxn];
long long ans[maxn];
void dfs(long long a) {
  vis[a] = 1;
  topol.push_back(a);
  for (long long i = 0; i < gerrr[a].size(); i++) {
    long long v = gerrr[a][i];
    if (vis[v] == 0) {
      dfs(v);
    }
  }
  return;
}
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long v, u;
    cin >> v >> u;
    v--;
    u--;
    ger[v].push_back(u);
    ger[u].push_back(v);
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < ger[i].size(); j++) {
      hash1[i] += poww1(737, ger[i][j]);
      hash1[i] %= mod;
    }
    hash1[i] += poww1(737, i);
    hash1[i] %= mod;
    for (long long j = 0; j < ger[i].size(); j++) {
      hash2[i] += poww2(959, ger[i][j]);
      hash2[i] %= mod2;
    }
    hash2[i] += poww2(959, i);
    hash2[i] %= mod2;
    t[i] = make_pair(make_pair(hash1[i], hash2[i]), i);
  }
  sort(t, t + n);
  long long last = 0;
  long long p = 1;
  for (long long i = 1; i < n; i++) {
    if (t[i].first != t[i - 1].first) {
      for (long long j = last; j < i; j++) {
        moa[t[j].second] = p;
      }
      p++;
      last = i;
    }
  }
  for (long long j = last; j < n; j++) {
    moa[t[j].second] = p;
  }
  p++;
  for (long long i = 0; i < n; i++) {
    h[moa[i]]++;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < ger[i].size(); j++) {
      long long v = ger[i][j];
      if (moa[v] != moa[i]) {
        gerrrst[moa[v]].insert(moa[i]);
        gerrrst[moa[i]].insert(moa[v]);
      }
    }
  }
  for (long long i = 1; i < p; i++) {
    if (gerrrst[i].size() > 2) {
      cout << "NO";
      return 0;
    }
  }
  for (long long i = 0; i < p; i++) {
    for (set<long long>::iterator it = gerrrst[i].begin();
         it != gerrrst[i].end(); it++) {
      gerrr[i].push_back(*it);
    }
  }
  for (long long i = 1; i < p; i++) {
    if (vis[i] == 0 && gerrr[i].size() < 2) {
      dfs(i);
    }
  }
  for (long long i = 1; i < p; i++) {
    if (vis[i] == 0) {
      cout << "NO";
      return 0;
    }
  }
  for (long long i = 0; i < topol.size(); i++) {
    koj[topol[i]] = i;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < ger[i].size(); j++) {
      long long v = ger[i][j];
      if (abs(koj[moa[v]] - koj[moa[i]]) > 1) {
        cout << "NO";
        return 0;
      }
      if (moa[v] != moa[i]) {
        cc[min(koj[moa[v]], koj[moa[i]])]++;
      }
    }
  }
  for (long long i = 1; i < topol.size(); i++) {
    long long v = topol[i - 1];
    long long u = topol[i];
    if (cc[koj[v]] != 0 && cc[koj[v]] != h[v] * h[u] * 2) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  ans[topol[0]] = 1;
  for (long long i = 1; i < topol.size(); i++) {
    long long v = topol[i - 1];
    long long u = topol[i];
    if (cc[koj[v]] == 0) {
      ans[u] = ans[v] + 5;
    } else {
      ans[u] = ans[v] + 1;
    }
  }
  for (long long i = 0; i < n; i++) {
    cout << ans[moa[i]] << ' ';
  }
}
