#include <bits/stdc++.h>
const int Max = 60;
int f[Max], d[Max];
bool is[Max][Max];
int N, M;
int find(int x) { return x == f[x] ? x : f[x] = find(f[x]); }
bool ck() {
  for (int i = 1; i <= N; ++i) {
    if (d[i] != 2) {
      return false;
    }
  }
  return true;
}
int main() {
  std::cin >> N >> M;
  if (N == 1 && M == 0) {
    std::cout << "YES\n1\n1 1" << '\n';
    return 0;
  }
  for (int i = 1; i <= N; ++i) {
    f[i] = i;
  }
  bool sl = false, ex = false;
  for (int i = 0; i < M; ++i) {
    int x, y;
    std::cin >> x >> y;
    if (x == y) {
      sl = true;
    }
    if (is[x][y]) {
      ex = true;
    }
    is[x][y] = true;
    ++d[x];
    ++d[y];
    x = find(x);
    y = find(y);
    if (x != y) {
      f[y] = x;
    }
  }
  if (N >= 2 && (sl || ex)) {
    std::cout << "NO" << '\n';
    return 0;
  }
  for (int i = 1; i <= N; ++i) {
    if (d[i] > 2) {
      std::cout << "NO" << '\n';
      return 0;
    }
  }
  std::cout << "YES" << '\n';
  if (ck() && M == N) {
    std::cout << 0 << '\n';
    return 0;
  }
  std::vector<std::pair<int, int>> ans;
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= N; ++j) {
      if (i == j) {
        continue;
      }
      if (d[i] <= 1 && d[j] <= 1 && find(i) != find(j)) {
        ++d[i];
        ++d[j];
        f[find(j)] = find(i);
        ans.push_back({i, j});
      }
    }
  }
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= N; ++j) {
      if (i == j) {
        continue;
      }
      if (d[i] == 1 && d[j] == 1) {
        ans.push_back({i, j});
        std::cout << ans.size() << '\n';
        for (auto i : ans) {
          std::cout << i.first << " " << i.second << '\n';
        }
        return 0;
      }
    }
  }
}
