#include <bits/stdc++.h>
using namespace ::std;
int MAXN = 3e5 + 5;
int MAXM = 3e5 + 5;
int N, M;
vector<vector<int> > adj(MAXN, vector<int>(0));
vector<vector<long long> > has(3, vector<long long>(MAXN, 1));
vector<int> P(3);
vector<bool> tovis(MAXN, 1);
vector<int> col(MAXN, -1);
int COL = 1;
vector<bool> visit(MAXN, 0);
vector<bool> visit1(MAXN, 0);
vector<int> corr(MAXN);
void dfs(int pos, int parent) {
  if (visit[pos] == 1) {
    cout << "NO";
    exit(0);
  }
  visit[pos] = 1;
  for (auto j : adj[pos]) {
    if (tovis[j] && j != parent) {
      dfs(j, pos);
    }
  }
}
int dfs1(int pos, int parent) {
  visit1[pos] = 1;
  col[pos] = COL;
  COL++;
  for (auto j : adj[pos]) {
    if (tovis[j] && j != parent) {
      dfs1(j, pos);
    }
  }
}
int rec(int pos) {
  if (col[pos] == -1) {
    col[pos] = rec(corr[pos]);
    return col[pos];
  }
  return col[pos];
}
int main() {
  ios::sync_with_stdio(false);
  ifstream fin("input.txt");
  cin >> N >> M;
  P[0] = 1e9 + 7;
  P[1] = 1e9 + 9;
  P[2] = 1e9 + 11;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < 3; j++) {
      has[j][i] = i;
    }
  }
  for (int i = 0; i < M; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    for (int j = 0; j < 3; j++) {
      has[j][u] = (has[j][u] * v) % P[j];
      has[j][v] = (has[j][v] * u) % P[j];
    }
  }
  for (int i = 1; i <= N; i++) {
    for (auto j : adj[i]) {
      if (tovis[j] == 1) {
        bool stat = 1;
        for (int k = 0; k < 3; k++) {
          if (has[k][i] != has[k][j]) {
            stat = 0;
          }
        }
        if (stat == 1) {
          tovis[i] = 0;
          corr[i] = j;
        }
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    if (tovis[i] == 1 && visit[i] == 0) {
      dfs(i, -1);
    }
  }
  vector<int> outgoing(N + 1, 0);
  for (int i = 1; i <= N; i++) {
    if (tovis[i] == 1) {
      for (auto j : adj[i]) {
        if (tovis[j] == 1) {
          outgoing[i]++;
        }
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    if (tovis[i] == 1 && outgoing[i] > 2) {
      cout << "NO";
      return 0;
    }
    if ((outgoing[i] == 1 || outgoing[i] == 0) && tovis[i] == 1 &&
        visit1[i] == 0) {
      dfs1(i, -1);
    }
  }
  for (int i = 1; i <= N; i++) {
    if (col[i] == -1) {
      rec(i);
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= N; i++) {
    cout << col[i] << " ";
  }
}
