#include <bits/stdc++.h>
using namespace std;
vector<int> graph[300005];
vector<int> condensedgraph[300005];
map<vector<int>, int> ind;
int type[300005];
int cnt = 0;
bool DEBUG = false;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  for (int i = 1; i <= N; i++) {
    graph[i].push_back(i);
  }
  for (int i = 1; i <= N; i++) {
    sort(graph[i].begin(), graph[i].end());
    if (ind.find(graph[i]) == ind.end()) {
      ind[graph[i]] = cnt;
      cnt++;
    }
    type[i] = ind[graph[i]];
  }
  for (int i = 1; i <= N; i++) {
    for (int u : graph[i]) {
      int r = type[i];
      int s = type[u];
      if (r != s) {
        condensedgraph[r].push_back(s);
      }
    }
  }
  for (int i = 0; i < cnt; i++) {
    sort(condensedgraph[i].begin(), condensedgraph[i].end());
    condensedgraph[i].erase(
        unique(condensedgraph[i].begin(), condensedgraph[i].end()),
        condensedgraph[i].end());
  }
  int rt = -1;
  for (int i = 0; i < cnt; i++) {
    if (condensedgraph[i].size() == 1) {
      rt = i;
    }
  }
  if (rt == -1 && cnt > 1) {
    if (!DEBUG) {
      cout << "NO" << endl;
      return 0;
    }
    if (DEBUG) {
      cout << "TJ" << endl;
    }
  }
  bool vis[cnt];
  int depth[cnt];
  for (int i = 0; i < cnt; i++) {
    depth[i] = 0;
  }
  memset(vis, false, sizeof(vis));
  queue<int> q;
  q.push(rt);
  int E = 0;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    if (vis[v]) continue;
    vis[v] = true;
    for (int r : condensedgraph[v]) {
      if (!vis[r]) {
        E++;
        depth[r] = depth[v] + 1;
        q.push(r);
      }
    }
  }
  if (E != cnt - 1) {
    if (!DEBUG) {
      cout << "NO" << endl;
      return 0;
    }
    if (DEBUG) {
      cout << "SCREW" << endl;
    }
  }
  bool val = false;
  for (int i = 0; i < cnt; i++) {
    if (depth[i] == cnt - 1) {
      val = true;
    }
  }
  if (!val) {
    if (!DEBUG) {
      cout << "NO" << endl;
      return 0;
    }
    if (DEBUG) {
      cout << "FINNA" << endl;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= N; i++) {
    cout << depth[type[i]] + 1 << ' ';
  }
  cout << endl;
}
