#include <bits/stdc++.h>
using namespace std;
int par[51];
int n, m, deg[51];
vector<pair<int, int> > edg;
int root(int u) { return (par[u] < 0 ? u : par[u] = root(par[u])); }
bool unionn(int u, int v) {
  u = root(u);
  v = root(v);
  if (u == v) return false;
  if (-par[u] < -par[v]) swap(u, v);
  par[u] += par[v];
  par[v] = u;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = int(1); i <= int(n); i++) par[i] = -1;
  for (int i = int(1); i <= int(m); i++) {
    int u, v;
    cin >> u >> v;
    unionn(u, v);
    deg[u]++, deg[v]++;
  }
  for (int i = int(1); i <= int(n); i++)
    for (int j = int(i + 1); j <= int(n); j++) {
      if (deg[i] < 2 && deg[j] < 2) {
        if (unionn(i, j)) {
          edg.push_back({i, j});
          m++;
          deg[i]++, deg[j]++;
        }
      }
    }
  if (m == n - 1) {
    int u = 0, v = 0;
    for (int i = int(1); i <= int(n); i++) {
      if (deg[i] < 2) {
        if (!u)
          u = i;
        else
          v = i;
      }
      if (u && v) break;
    }
    if (!v) v = u;
    edg.push_back({u, v});
  }
  for (int i = int(1); i <= int(n); i++)
    if (deg[i] > 2) {
      cout << "NO";
      exit(0);
    }
  if (m > n) {
    cout << "NO";
    exit(0);
  }
  int cnt = 0;
  for (int i = int(1); i <= int(n); i++) cnt += (par[i] < 0);
  if (cnt != 1) {
    cout << "NO";
    exit(0);
  }
  cout << "YES" << endl;
  cout << int(edg.size()), cout << '\n';
  for (auto e : edg) {
    cout << e.first << ' ' << e.second, cout << '\n';
  }
}
