#include <bits/stdc++.h>
using namespace std;
int n, m, lab;
pair<set<int>, int> graph[300005];
int label[300005];
int endlabel[300005];
set<int> aug_graph[300005];
set<int> aug_node[300005];
bool valid() {
  bool cycle = true;
  int start;
  for (int i = 0; i < n; ++i) {
    aug_node[label[graph[i].second]].insert(graph[i].second);
    if (i == 0 || graph[i - 1].first != graph[i].first) {
      aug_graph[label[graph[i].second]].insert(label[graph[i].second]);
      for (set<int>::iterator it = graph[i].first.begin();
           it != graph[i].first.end(); ++it) {
        aug_graph[label[graph[i].second]].insert(label[*it]);
      }
      int sz = aug_graph[label[graph[i].second]].size();
      if (sz > 3)
        return false;
      else if (sz == 2) {
        cycle = false;
        start = label[graph[i].second];
      }
    }
  }
  if (cycle) return false;
  int cur = start, prev;
  lab = 1;
  while (true) {
    for (set<int>::iterator it = aug_node[cur].begin();
         it != aug_node[cur].end(); ++it) {
      endlabel[*it] = lab;
    }
    if (lab != 1) aug_graph[cur].erase(prev);
    aug_graph[cur].erase(cur);
    prev = cur;
    if (aug_graph[prev].size() == 0) break;
    cur = *(aug_graph[prev].begin());
    lab++;
  }
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    graph[x].first.insert(y);
    graph[y].first.insert(x);
  }
  for (int i = 0; i < n; ++i) {
    graph[i].first.insert(i);
    graph[i].second = i;
  }
  sort(graph, graph + n);
  lab = 1;
  for (int i = 0; i < n; ++i) {
    if (i == 0) {
      label[graph[i].second] = lab;
    } else if (graph[i - 1].first == graph[i].first)
      label[graph[i].second] = label[graph[i - 1].second];
    else {
      label[graph[i].second] = label[graph[i - 1].second] + 1;
      lab++;
    }
  }
  if (lab == 1) {
    cout << "YES" << endl;
    cout << label[0];
    for (int i = 1; i < n; ++i) {
      cout << " " << label[i];
    }
    cout << endl;
    return 0;
  }
  if (valid()) {
    cout << "YES" << endl;
    cout << endlabel[0];
    for (int i = 1; i < n; ++i) {
      cout << " " << endlabel[i];
    }
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
