#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int mod = (int)1e+9 + 7;
const double pi = acos(-1.);
const int maxn = 100100;
vector<int> rb[maxn];
vector<pair<int, int> > vc;
int snm[maxn];
int getroot(int u) { return (snm[u] == u ? u : snm[u] = getroot(snm[u])); }
bool merge(int u, int v) {
  u = getroot(u), v = getroot(v);
  if (u == v) return (0);
  snm[u] = v;
  return (1);
}
int main() {
  {
    srand(time(0));
    const string file = "";
    if (!file.empty()) {
      freopen((file + ".in").c_str(), "r", stdin);
      freopen((file + ".out").c_str(), "w", stdout);
    }
  }
  for (int i = 0; i < maxn; i++) snm[i] = i;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    rb[u].push_back(v);
    rb[v].push_back(u);
    merge(u, v);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (rb[i].size() != 2 && rb[j].size() != 2 && merge(i, j)) {
        rb[i].push_back(j);
        rb[j].push_back(i);
        vc.push_back(make_pair(i, j));
      }
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (rb[i].size() == 2) continue;
    for (int j = i + 1; j <= n; j++) {
      if (rb[j].size() == 2) continue;
      if (rb[i].size() + rb[j].size() <= 2) {
        rb[i].push_back(j);
        rb[j].push_back(i);
        vc.push_back(make_pair(i, j));
        cnt++;
      }
    }
    if (rb[i].size() + rb[i].size() == 0) {
      rb[i].push_back(i);
      rb[i].push_back(i);
      vc.push_back(make_pair(i, i));
      cnt++;
    }
  }
  bool ok = 1;
  for (int i = 1; i <= n; i++) {
    if (rb[i].size() != 2) {
      ok = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (merge(i, j)) ok = 0;
    }
  }
  if (!ok || cnt > 1) {
    cout << "NO";
    return (0);
  }
  sort(vc.begin(), vc.end());
  cout << "YES\n" << vc.size() << endl;
  for (int i = 0; i < vc.size(); i++) {
    cout << vc[i].first << " " << vc[i].second << endl;
    ;
  }
  return (0);
}
