#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long inf64 = 0x3f3f3f3f3f3f3f3fLL;
const int maxn = 128;
char was[maxn];
int where[maxn];
vector<int> g[maxn];
vector<int> c[maxn];
int deg[maxn];
void go(int v, int com) {
  was[v] = 1;
  where[v] = com;
  c[com].push_back(v);
  for (int i = 0; i < g[v].size(); i++) {
    int p = g[v][i];
    if (was[p]) continue;
    go(p, com);
  }
}
int n;
int rego() {
  for (int i = 0; i < maxn; i++) c[i].clear();
  memset(was, 0, sizeof(was));
  int comp = 0;
  for (int i = 0; i < n; i++)
    if (!was[i]) {
      go(i, comp);
      comp++;
    }
  return comp;
}
int main() {
  int m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  bool all2 = true;
  for (int i = 0; i < n; i++) {
    deg[i] = g[i].size();
    if (deg[i] != 2) all2 = false;
  }
  go(0, 0);
  bool allreached = true;
  for (int i = 0; i < n; i++)
    if (!was[i]) allreached = false;
  if (all2 && allreached) {
    printf("YES\n0\n");
    return 0;
  }
  for (int i = 0; i < n; i++)
    if (deg[i] > 2) {
      puts("NO");
      return 0;
    }
  if (m >= n) {
    puts("NO");
    return 0;
  }
  int comp = rego();
  for (int i = 0; i < comp; i++) {
    bool hasone = false;
    for (int j = 0; j < c[i].size(); j++) {
      if (deg[c[i][j]] < 2) hasone = true;
    }
    if (!hasone) {
      puts("NO");
      return 0;
    }
  }
  vector<pair<int, int> > res;
  for (;;) {
    bool any = false;
    memset(was, 0, sizeof(was));
    for (int i = 0; !any && i < n; i++)
      if (deg[i] < 2) {
        go(i, 0);
        for (int j = i + 1; j < n; j++)
          if (deg[j] < 2 && !was[j]) {
            any = true;
            deg[i]++;
            deg[j]++;
            g[i].push_back(j);
            g[j].push_back(i);
            res.push_back(pair<int, int>(i, j));
            break;
          }
      }
    if (any) continue;
    memset(was, 0, sizeof(was));
    for (int i = 0; i < n; i++)
      if (deg[i] < 2) {
        deg[i]++;
        for (int j = i; j < n; j++)
          if (deg[j] < 2) {
            deg[j]++;
            g[i].push_back(j);
            g[j].push_back(i);
            any = true;
            res.push_back(pair<int, int>(i, j));
            break;
          }
        if (any) break;
      }
    if (!any) break;
  }
  assert(res.size() == n - m);
  puts("YES");
  printf("%d\n", res.size());
  for (int i = 0; i < res.size(); i++) {
    printf("%d %d\n", res[i].first + 1, res[i].second + 1);
  }
  return 0;
}
