#include <bits/stdc++.h>
using namespace std;
int n;
int g[50][50], p[50], used[50], deg[50];
int pred(int a) {
  if (a == p[a]) return a;
  p[a] = pred(p[a]);
  return p[a];
}
void dfs(int v) {
  used[v] = 1;
  for (int i = 0; i < n; i++)
    if (!used[i] && g[v][i]) dfs(i);
}
bool dfs1(int v, int p) {
  used[v] = 1;
  for (int i = 0; i < n; i++)
    if (used[i] && (g[v][i] > 1 || (g[v][i] && p != i)))
      return true;
    else if (!used[i] && g[v][i] && dfs1(i, v))
      return true;
  return false;
}
int main() {
  int m, a, b;
  cin >> n >> m;
  for (int i = 0; i < n; i++) p[i] = i;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    --a;
    --b;
    ++g[a][b];
    ++g[b][a];
    ++deg[a];
    ++deg[b];
    if (pred(a) == pred(b)) continue;
    p[pred(a)] = pred(b);
  }
  bool ok = true;
  for (int i = 0; i < n; i++)
    if (deg[i] > 2) {
      cout << "NO";
      return 0;
    } else if (deg[i] != 2)
      ok = false;
  dfs(0);
  for (int i = 0; i < n; i++)
    if (!used[i]) ok = false;
  if (ok) {
    cout << "YES" << endl << 0;
    return 0;
  }
  if (m >= n) {
    cout << "NO";
    return 0;
  }
  memset(used, 0, sizeof(used));
  for (int i = 0; i < n; i++)
    if (!used[i] && dfs1(i, -1)) {
      cout << "NO";
      return 0;
    }
  vector<pair<int, int> > ans;
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++)
      if (deg[i] < 2 && deg[j] < 2 && pred(i) != pred(j)) {
        ++deg[i];
        ++deg[j];
        ans.push_back(make_pair(i + 1, j + 1));
        p[pred(i)] = pred(j);
      }
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++)
      if (deg[i] < 2 && deg[j] < 2) {
        ++deg[i];
        ++deg[j];
        ans.push_back(make_pair(i + 1, j + 1));
      }
  for (int i = 0; i < n; i++)
    if (deg[i] < 2) {
      ans.push_back(make_pair(i + 1, i + 1));
      deg[i] -= 2;
    }
  cout << "YES" << endl << ans.size() << endl;
  for (size_t i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
