#include <bits/stdc++.h>
using namespace std;
long long n, m, u, v;
vector<long long> adj[51];
long long parent[51];
void intilize() {
  for (int i = 1; i <= n; i++) parent[i] = i;
}
long long root(long long a) {
  long long x = parent[a];
  while (x != parent[x]) {
    parent[x] = parent[parent[x]];
    x = parent[x];
  }
  return x;
}
void make_union(long long a, long long b) {
  long long roota = root(a), rootb = root(b);
  if (roota < rootb) {
    parent[rootb] = roota;
  } else {
    parent[roota] = rootb;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  long long t = 1;
  while (t--) {
    bool flag = false;
    cin >> n >> m;
    intilize();
    if (n == 1 && m == 0) {
      cout << "YES\n1\n1 1\n";
      continue;
    }
    for (int i = 0; i < m; i++) {
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
      make_union(u, v);
      if (adj[u].size() > 2 || adj[v].size() > 2) flag = true;
    }
    if (flag || m > n) {
      cout << "NO\n";
      continue;
    } else {
      if (n == m) {
        for (int i = 2; i <= n; i++) {
          if (root(i) != root(i - 1)) flag = true;
        }
        if (flag)
          cout << "NO\n";
        else
          cout << "YES\n0\n";
      } else {
        long long ctr = 0;
        for (int i = 1; i <= n; i++) {
          if (adj[i].size() < 2) ctr++;
        }
        if (ctr < 2) {
          cout << "NO\n";
          continue;
        }
        flag = false;
        long long curr, prev = 1;
        while (adj[prev].size() == 2) prev++;
        cout << "YES\n" << (n - m) << endl;
        for (int i = 2; i <= n; i++) {
          if (root(prev) != root(i) && adj[i].size() < 2) {
            make_union(prev, i);
            adj[prev].push_back(i);
            adj[i].push_back(prev);
            cout << prev << ' ' << i << endl;
            while (adj[prev].size() == 2) prev++;
          }
        }
        for (int i = 1; i <= n; i++)
          if (adj[i].size() == 1) cout << i << ' ';
      }
    }
  }
  return 0;
}
