#include <bits/stdc++.h>
using namespace std;
int arr[55], st[55];
int getRoot(int v) {
  if (arr[v] == v) return v;
  return arr[v] = getRoot(arr[v]);
}
void unite(int a, int b) { arr[getRoot(a)] = getRoot(b); }
int main() {
  for (int i = 0; i < 55; i++) arr[i] = i;
  int n, m, mx = 0, cnt = 0;
  bool isCycle = false;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    if (getRoot(a) == getRoot(b)) {
      isCycle = true;
      cnt++;
    }
    st[a]++;
    st[b]++;
    unite(a, b);
    mx = max(mx, max(st[a], st[b]));
  }
  if (mx > 2)
    cout << "NO";
  else if (isCycle && mx == 2 && m == n && cnt == 1)
    cout << "YES" << endl << 0;
  else if (isCycle)
    cout << "NO";
  else {
    cout << "YES" << endl;
    cout << n - m << endl;
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++)
        if (st[i] < 2 && st[j] < 2 && getRoot(i) != getRoot(j)) {
          cout << i << " " << j << endl;
          st[i]++;
          st[j]++;
          unite(i, j);
        }
    for (int i = 1; i <= n; i++)
      for (int j = n; j >= i; j--)
        if (st[i] < 2 && st[j] < 2) {
          cout << i << " " << j << endl;
          st[i] = st[j] = 2;
        }
  }
  return 0;
}
