#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1e9 + 7;
const int N = 15, M = 1e5 + 10, NM1 = N - 1;
long long int OO = 1e18 + 8;
int oo = 1e9 + 8;
void readFile() {}
struct DSU {
  vector<int> par, sz;
  DSU(int n) {
    par.resize(n), sz.resize(n), iota(par.begin(), par.end(), 0),
        fill(sz.begin(), sz.end(), 1);
  }
  int leader(int u) { return (par[u] == u) ? u : par[u] = leader(par[u]); }
  bool join(int u, int v) {
    int p1 = leader(u), p2 = leader(v);
    if (p1 == p2) return false;
    if (sz[p1] < sz[p2]) swap(p1, p2);
    par[p2] = p1;
    sz[p1] += sz[p2];
    return true;
  }
} dsu(1);
int n, m, u, v, deg[55];
int main() {
  readFile();
  scanf("%d%d", &n, &m);
  dsu = DSU(n);
  bool ok = 1;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    deg[--u]++, deg[--v]++;
    if (deg[u] > 2 || deg[v] > 2 || (u == v && n != 1)) ok = 0;
    if (!dsu.join(u, v) && i != n - 1) ok = 0;
  }
  if (!ok || n < m) return puts("NO"), 0;
  int cnt = n - m;
  printf("YES\n%d\n", cnt);
  for (int i = 0; i < n && cnt; i++) {
    for (int k = 0; k < 2; k++) {
      for (int j = i + 1; j < n && cnt && deg[i] < 2; j++) {
        if (deg[j] < 2 && deg[i] < 2 && dsu.join(i, j)) {
          printf("%d %d\n", i + 1, j + 1);
          deg[i]++, deg[j]++;
        }
      }
    }
  }
  for (int i = 0; i < n; i++)
    while (deg[i] < 2) {
      printf("%d ", i + 1);
      deg[i]++;
    }
  return 0;
}
