#include <bits/stdc++.h>
using namespace std;
int p[64];
int s[64];
int pa(int v) {
  if (p[v] != v) {
    p[v] = pa(p[v]);
  }
  return p[v];
}
void unite(int v1, int v2) { p[pa(v1)] = pa(v2); }
int main() {
  int n, m;
  cin >> n >> m;
  if (m > n) {
    cout << "NO";
    return 0;
  }
  if (n == 1) {
    if (m == 0) {
      cout << "YES" << endl;
      cout << "1" << endl;
      cout << "1 1" << endl;
    } else if (m == 1) {
      cout << "YES" << endl;
      cout << "0" << endl;
    } else {
      cout << "NO";
    }
    return 0;
  }
  memset(s, 0, sizeof(s));
  for (int i = 0; i < n; ++i) {
    p[i] = i;
  }
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    if (a == b || (m < n || i < m - 1) && pa(a) == pa(b) || s[a] > 1 ||
        s[b] > 1) {
      cout << "NO";
      return 0;
    }
    ++s[a];
    ++s[b];
    unite(a, b);
  }
  cout << "YES" << endl;
  cout << n - m << endl;
  for (int j = 0; j < n; ++j) {
    while (s[j] <= 1) {
      for (int k = j + 1; k < n; ++k) {
        if (s[k] <= 1 && (m == n - 1 || pa(j) != pa(k))) {
          cout << j + 1 << ' ' << k + 1 << endl;
          ++s[j];
          ++s[k];
          ++m;
          unite(j, k);
          break;
        }
      }
    }
  }
  return 0;
}
