#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
const int dxx[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
          dyy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long mod = 1000000007;
const int base = 311;
const int N = 55;
int n, m;
map<pair<int, int>, int> M;
vector<int> dsk[N];
int deg[N];
int par[N];
int root(int u) { return (par[u] < 0 ? u : par[u] = root(par[u])); }
bool dsu(int u, int v) {
  if ((u = root(u)) == (v = root(v))) return 0;
  if (par[u] > par[v]) swap(u, v);
  par[u] += par[v];
  par[v] = u;
  return 1;
}
void gogo() {
  cin >> n >> m;
  memset(par, -1, sizeof(par));
  if (n == 1) {
    if (m == 1)
      cout << "YES\n0";
    else if (m == 0) {
      cout << "YES\n1\n1 1";
    } else
      cout << "NO";
    return;
  }
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    if (u == v) {
      cout << "NO\n";
      return;
    }
    M[make_pair(u, v)] = 1;
    M[make_pair(v, u)] = 1;
    dsk[u].push_back(v);
    dsk[v].push_back(u);
    ++deg[v];
    ++deg[u];
    dsu(u, v);
  }
  if (((int)(M).size()) / 2 > n) {
    cout << "NO";
    return;
  } else if (((int)(M).size()) / 2 == n) {
    int ok = 1;
    for (int i = 1; i <= n; ++i) {
      ok &= (deg[i] == 2);
    }
    if (ok)
      cout << "YES\n0";
    else
      cout << "NO\n";
    return;
  }
  int ok = 1;
  for (int i = 1; i <= n; ++i) {
    ok &= (deg[i] <= 2);
  }
  if (!ok) {
    cout << "NO";
    return;
  }
  vector<pair<int, int> > ans;
  for (int k = 1; k <= 5; ++k) {
    for (int i = 1; i <= n; ++i) {
      for (int j = i + 1; j <= n; ++j) {
        if (!(deg[i] < 2 && deg[j] < 2)) continue;
        if (!dsu(i, j)) {
          int cnt = -par[root(i)];
          if (cnt == 0 || cnt == n) {
            ans.push_back(make_pair(i, j));
            ++deg[i];
            ++deg[j];
          }
        } else {
          ans.push_back(make_pair(i, j));
          ++deg[i];
          ++deg[j];
        }
      }
    }
  }
  ok = 1;
  for (int i = 1; i <= n; ++i) ok &= (deg[i] == 2);
  if (!ok) {
    cout << "NO";
    return;
  }
  cout << "YES\n";
  cout << ((int)(ans).size()) << '\n';
  for (pair<int, int> i : ans) cout << i.first << ' ' << i.second << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("sol"
            ".inp",
            "r")) {
    freopen(
        "sol"
        ".inp",
        "r", stdin);
    freopen(
        "sol"
        ".out",
        "w", stdout);
  }
  gogo();
  return 0;
}
