#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 55;
const double eps = 1e-8;
int n, m;
int fa[maxn];
int degree[maxn];
bool g[maxn][maxn];
int find(int a) {
  if (fa[a] != a) fa[a] = find(fa[a]);
  return fa[a];
}
bool check() {
  for (int i = 1; i <= n; i++)
    if (degree[i] != 2) return false;
  for (int i = 1; i <= n; i++)
    if (find(i) != find(1)) return false;
  return true;
}
int main() {
  int x, y;
  for (int i = 0; i < maxn; i++) fa[i] = i;
  bool huan = false, cnt = false;
  scanf("%d %d", &n, &m);
  if (n == 1 && m == 0) {
    printf("YES\n1\n1 1\n");
    return 0;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    degree[x]++;
    degree[y]++;
    g[x][y] = g[y][x] = true;
    if (degree[x] > 2 || degree[y] > 2) cnt = true;
    int pa = find(x);
    int pb = find(y);
    if (pa == pb) huan = true;
    fa[pa] = pb;
  }
  if (check()) {
    printf("YES\n0\n");
    return 0;
  }
  if (huan || cnt || m >= n) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  vector<pair<int, int> > ans;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      if (degree[i] < 2 && degree[j] < 2 && !g[i][j] && find(i) != find(j)) {
        ans.push_back(make_pair(i, j));
        fa[find(i)] = fa[find(j)];
        degree[i]++;
        degree[j]++;
      }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      if (degree[i] < 2 && degree[j] < 2) ans.push_back(make_pair(i, j));
  sort(ans.begin(), ans.end());
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
