#include <bits/stdc++.h>
using namespace std;
int parent[51];
int adjNums[51];
int getParent(int son) {
  int sonParent = parent[son];
  if (sonParent != parent[sonParent]) parent[son] = getParent(sonParent);
  return parent[son];
}
int main() {
  int n, m, u, v, uParent, vParent;
  bool ok = true;
  cin >> n >> m;
  if (n == 1 && m == 0) return cout << "YES\n1\n 1 1" << flush, 0;
  for (int i = 0; i <= n; i++) parent[i] = i;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    if (!ok) continue;
    uParent = getParent(u);
    vParent = getParent(v);
    adjNums[u]++;
    adjNums[v]++;
    if (adjNums[u] > 2 || adjNums[v] > 2) {
      ok = false;
      continue;
    }
    if (uParent != vParent)
      parent[vParent] = uParent;
    else
      ok = false;
  }
  if (m > n) return cout << "NO" << endl, 0;
  if (!ok) {
    int count = 0;
    for (int i = 1; i <= n; i++)
      if (i == parent[i]) count++;
    if (count > 1) return cout << "NO" << endl, 0;
    return cout << "YES\n0" << endl, 0;
  } else {
    if (n == m) {
      cout << "YES\n0" << flush;
      return 0;
    }
    cout << "YES\n" << n - m << endl;
    for (u = 1; u <= n; u++) {
      if (adjNums[u] == 2) continue;
      uParent = getParent(u);
      for (v = u + 1; v <= n; v++) {
        vParent = getParent(v);
        if (adjNums[v] == 2 || vParent == uParent) continue;
        cout << u << " " << v << endl;
        parent[vParent] = uParent;
        adjNums[u]++;
        adjNums[v]++;
        if (adjNums[u] > 1) break;
      }
    }
    u = -1, v = -1;
    for (int i = 1; i <= n; i++)
      if (adjNums[i] == 2)
        continue;
      else if (u == -1)
        u = i;
      else {
        v = i;
        break;
      }
    cout << u << " " << v << flush;
  }
  return 0;
}
