#include <bits/stdc++.h>
const int MaxN = 55;
template <class t>
inline void read(t &s) {
  s = 0;
  register int f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  int buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool checkmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool checkmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline int lowbit(int x) { return x & (-x); }
int n, m;
int f[MaxN], deg[MaxN];
inline int getf(int x) { return f[x] == x ? x : f[x] = getf(f[x]); }
inline void merge(int u, int v) {
  register int a = getf(u), b = getf(v);
  if (a != b) f[b] = a;
}
inline void NO() { std::puts("NO"), exit(0); }
signed main(void) {
  std::vector<std::pair<int, int> > res;
  read(n, m);
  if (m > n) NO();
  if (n == 1) {
    if (m)
      std::printf("YES\n0\n");
    else
      std::printf("YES\n1\n1 1\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i) f[i] = i;
  register int u, v;
  for (int i = 1; i <= m; ++i) read(u, v), ++deg[u], ++deg[v], merge(u, v);
  for (int i = 1; i <= n; ++i)
    if (deg[i] > 2) NO();
  register int ans = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (getf(i) != getf(j) && deg[i] < 2 && deg[j] < 2)
        merge(i, j), ++ans, res.push_back(std::make_pair(i, j)), ++m, ++deg[i],
            ++deg[j];
  if (m > n) NO();
  if (n != m) {
    for (int i = 1; i <= n; ++i)
      if (deg[i] < 2)
        for (int j = i + 1; j <= n; ++j)
          if (deg[j] < 2)
            ++ans, res.push_back(std::make_pair(i, j)), ++deg[i], ++deg[j], ++m;
  }
  if (m != n) NO();
  for (int i = 1; i <= n; ++i)
    if (getf(i) != getf(1)) NO();
  std::puts("YES");
  write(ans), std::puts("");
  for (auto i : res)
    write(i.first), std::putchar(32), write(i.second), std::puts("");
  return 0;
}
