#include <bits/stdc++.h>
int n, m;
int fa[55], e[55][55];
int deg[55];
std::pair<int, int> ans[55];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  std::cin >> n >> m;
  if (n < m) {
    std::cout << "NO" << '\n';
    return 0;
  }
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1, a, b; i <= m; i++) {
    std::cin >> a >> b;
    e[a][b] = e[b][a] = 1;
    if (++deg[a] > 2 || ++deg[b] > 2) {
      std::cout << "NO" << '\n';
      return 0;
    }
    fa[find(a)] = fa[find(b)];
  }
  int num = 0;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      if (find(i) != find(j) && deg[i] < 2 && deg[j] < 2) {
        ans[++num] = {i, j};
        ++deg[i];
        ++deg[j];
        fa[find(i)] = find(j);
      }
  if (m + num == n - 1) {
    num++;
    for (int i = 1; i <= n; i++)
      while (deg[i] < 2) {
        deg[i]++;
        if (!ans[num].first)
          ans[num].first = i;
        else
          ans[num].second = i;
      }
  }
  for (int i = 1; i <= n; i++)
    if (find(i) != find(1)) {
      std::cout << "NO" << '\n';
      return 0;
    }
  std::cout << "YES" << '\n' << num << '\n';
  for (int i = 1; i <= num; i++)
    std::cout << ans[i].first << " " << ans[i].second << '\n';
  return 0;
}
