#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long n, m, cnt[55], used[55], add[55];
bool vis[55];
vector<long long> v[55], p;
pair<long long, long long> it[55];
long long fa[55];
long long getfa(long long x) {
  if (x == fa[x])
    return x;
  else
    return fa[x] = getfa(fa[x]);
}
void update(long long x, long long y) {
  x = getfa(x);
  y = getfa(y);
  fa[x] = y;
}
void dfs(long long x) {
  if (vis[x]) return;
  vis[x] = 1;
  p.emplace_back(x);
  for (auto u : v[x]) {
    dfs(u);
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  long long x, y;
  for (long long i = 1; i <= m; i++) {
    cin >> x >> y;
    v[x].emplace_back(y);
    v[y].emplace_back(x);
  }
  long long cnt = 0;
  for (long long i = 1; i <= n; i++)
    if (!vis[i]) {
      p.clear();
      dfs(i);
      long long lst = cnt;
      for (auto u : p) {
        if (v[u].size() > 2) {
          cout << "NO";
          return 0;
        }
        if (v[u].size() == 1) {
          if (cnt && it[cnt].second == 0) {
            it[cnt].second = u;
          } else {
            it[++cnt].first = u;
          }
        }
        if (v[u].empty()) {
          it[++cnt] = make_pair(u, u);
        }
      }
      if (lst == cnt) {
        if (p.size() == n) {
          cout << "YES\n0";
          return 0;
        } else {
          cout << "NO";
          return 0;
        }
      }
    }
  for (long long i = 1; i <= n; i++) fa[i] = i;
  for (long long i = 1; i <= cnt; i++) {
    if (it[i].first > it[i].second) swap(it[i].first, it[i].second);
    used[it[i].first]++;
    used[it[i].second]++;
    add[it[i].first] = add[it[i].second] = i;
  }
  sort(it + 1, it + cnt + 1);
  cout << "YES\n";
  cout << cnt << '\n';
  for (long long i = 1; i <= n; i++) {
    while (used[i]) {
      bool f = 1;
      for (long long j = i + 1; j <= n; j++)
        if (used[j]) {
          if (getfa(add[i]) != getfa(add[j])) {
            cout << i << ' ' << j << '\n';
            update(add[i], add[j]);
            used[i]--;
            used[j]--;
            f = 0;
            break;
          }
        }
      if (f) break;
    }
  }
  for (long long i = 1; i <= n; i++) {
    while (used[i]) {
      cout << i << ' ';
      used[i]--;
    }
  }
  return 0;
}
