#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100], kk;
int n, m, c1, c2, vb[100], cc, ff;
void dfs(int x) {
  c1++;
  vb[x] = 1;
  c2 += adj[x].size();
  for (int u : adj[x]) {
    if (!vb[u]) dfs(u);
  }
  return;
}
bool cmp(int u, int v) {
  memset(vb, 0, sizeof(vb));
  dfs(u);
  return (!vb[v]);
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!vb[i]) {
      c1 = c2 = 0;
      dfs(i);
      if (c1 * 2 == c2) cc = 1;
      ff++;
    }
  }
  if (cc && ff > 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  cout << n - m << endl;
  if (n == 1 && m == 0) {
    cout << "1 1" << endl;
    return 0;
  }
  while (m < n) {
    for (int i = 1; i <= n; i++)
      if (adj[i].size() < 2) kk.push_back(i);
    if (m == n - 1 && kk.size() == 2) {
      cout << kk[0] << " " << kk[1] << endl;
      return 0;
    }
    for (int i = 1; i < kk.size(); i++) {
      if (cmp(kk[0], kk[i])) {
        cout << kk[0] << " " << kk[i] << endl;
        adj[kk[0]].push_back(kk[i]);
        adj[kk[i]].push_back(kk[0]);
        break;
      }
    }
    kk.clear();
    m++;
  }
}
