#include <bits/stdc++.h>
using namespace std;
const int MAXN = 60;
pair<int, int> Ans[MAXN];
int n, m, u, v, In[MAXN], Fa[MAXN], cnt;
inline int Read() {
  int x = 0, f = 0;
  char c = getchar();
  while (!isdigit(c)) {
    f |= c == '-';
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f ? -x : x;
}
inline void Write(const int &x) {
  if (x < 0) {
    putchar('-');
    Write(-x);
    return;
  }
  if (x > 9) {
    Write(x / 10);
  }
  putchar((x % 10) ^ 48);
  return;
}
inline void MakeSet(const int &n) {
  for (register int i = 1; i <= n; ++i) {
    Fa[i] = i;
  }
  return;
}
inline int FindSet(const int &x) {
  return (Fa[x] ^ x) ? (Fa[x] = FindSet(Fa[x])) : x;
}
signed main() {
  register int i, j;
  n = Read(), m = Read(), MakeSet(n);
  if (n < m) {
    printf("NO\n");
    return 0;
  }
  for (i = 0; i ^ m; ++i) {
    u = Read(), v = Read();
    ++In[u], ++In[v];
    if (In[u] > 2 or In[v] > 2) {
      printf("NO\n");
      return 0;
    }
    Fa[FindSet(u)] = FindSet(v);
  }
  for (i = 1; i ^ n; ++i) {
    for (j = i + 1; j <= n; ++j) {
      if (FindSet(i) ^ FindSet(j) and In[i] < 2 and In[j] < 2) {
        Ans[++cnt] = make_pair(i, j);
        Fa[FindSet(i)] = FindSet(j);
        ++In[i], ++In[j];
      }
    }
  }
  if (m + cnt == n - 1) {
    ++cnt;
    for (i = 1; i <= n; ++i) {
      while (In[i] < 2) {
        ++In[i];
        if (!Ans[cnt].first) {
          Ans[cnt].first = i;
        } else {
          Ans[cnt].second = i;
          break;
        }
      }
    }
  }
  for (i = 1; i <= n; ++i) {
    if (FindSet(i) ^ FindSet(1)) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n%d\n", cnt);
  for (i = 1; i <= cnt; ++i) {
    printf("%d %d\n", Ans[i].first, Ans[i].second);
  }
  return 0;
}
