#include <bits/stdc++.h>
using namespace std;
long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const long long maxn = 100 + 5;
long long n, m;
vector<long long> Comp[maxn];
long long cmp;
bool mark[maxn];
long long cnt;
vector<long long> g[maxn];
bool cycle;
long long edgecnt;
long long where[maxn];
inline void dfs(long long node, long long pr = -1) {
  mark[node] = true;
  cnt++;
  edgecnt += g[node].size();
  Comp[cmp].push_back(node);
  where[node] = cmp;
  for (auto u : g[node]) {
    if (!mark[u])
      dfs(u, node);
    else if (u - pr)
      cycle = true;
  }
}
long long deg[maxn];
long long maxi;
bool e[maxn][maxn];
vector<pair<long long, long long> > edges;
int32_t main() {
  n = in(), m = in();
  for (long long i = 0; i < m; i++) {
    long long v = in() - 1, u = in() - 1;
    g[v].push_back(u), g[u].push_back(v);
    cycle |= e[v][u] || v == u;
    e[v][u] = true;
    deg[v]++, deg[u]++;
    maxi = max(maxi, max(deg[v], deg[u]));
  }
  for (long long i = 0; i < n; i++)
    if (!mark[i]) dfs(i), cmp++;
  edgecnt /= 2;
  if (cmp == 1 && maxi == 2 && edgecnt == n) return cout << "YES\n0\n", 0;
  if (maxi > 2 || cycle) return cout << "NO\n", 0;
  cout << "YES\n";
  while (cmp > 1) {
    for (long long i = 0; i < n; i++)
      for (long long j = 0; j < n; j++) {
        if (where[i] != where[j] && max(deg[i], deg[j]) < 2) {
          deg[i]++, deg[j]++;
          for (auto x : Comp[where[j]]) Comp[where[i]].push_back(x);
          for (auto x : Comp[where[i]]) where[x] = where[i];
          edges.push_back({i, j});
          cmp--;
          i = n;
          break;
        }
      }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (n == 1 || (i - j && deg[i] == 1 && deg[j] == 1)) {
        edges.push_back({i, j});
        deg[i]++, deg[j]++;
      }
    }
  }
  cout << edges.size() << "\n";
  sort(edges.begin(), edges.end());
  for (auto x : edges) cout << x.first + 1 << " " << x.second + 1 << "\n";
}
