#include <bits/stdc++.h>
using namespace std;
int a[55][55], d[55], vis[55], f[55];
int i, j, k, n, m, id;
bool dfs(int u, int f) {
  vis[u] = id;
  for (int v = 1; v <= n; ++v)
    if (a[u][v] && v != f) {
      if (!vis[v]) {
        if (dfs(v, u)) return 1;
      } else
        return 1;
    }
  return 0;
}
bool ok() {
  for (i = 1; i <= n; ++i)
    for (j = i; j <= n; ++j)
      if (a[i][j] > 1) return 0;
  for (i = 1; i <= n; ++i)
    if (d[i] > 2) return 0;
  int flag = 0;
  id = 0;
  for (i = 1; i <= n; ++i)
    if (!vis[i]) {
      ++id;
      if (dfs(i, i)) ++flag;
    }
  if (flag > 1) return 0;
  if (flag)
    for (i = 1; i <= n; ++i)
      if (d[i] != 2) return 0;
  return 1;
}
int find(int x) {
  if (f[x] != x) f[x] = find(f[x]);
  return f[x];
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    memset(a, 0, sizeof(a));
    memset(d, 0, sizeof(d));
    memset(vis, 0, sizeof(vis));
    while (m--) {
      scanf("%d%d", &i, &j);
      ++a[i][j], ++a[j][i];
    }
    for (i = 1; i <= n; ++i)
      if (a[i][i] > 2) break;
    if (i <= n) {
      puts("NO");
      continue;
    }
    if (n == 1) {
      puts("YES");
      if (a[1][1])
        puts("0");
      else
        puts("1\n1 1");
      continue;
    }
    for (i = 1; i <= n; ++i)
      if (a[i][i]) break;
    if (i <= n) {
      puts("NO");
      continue;
    }
    if (n == 2) {
      puts("YES");
      if (!a[1][2])
        puts("2\n1 2\n1 2");
      else if (a[1][2] == 1)
        puts("1\n1 2");
      else
        puts("0");
      continue;
    }
    for (i = 1; i <= n; ++i)
      for (j = i + 1; j <= n; ++j)
        if (a[i][j]) ++d[i], ++d[j];
    if (!ok())
      puts("NO");
    else {
      puts("YES");
      for (k = 0, i = 1; i <= n; ++i) k += 2 - d[i];
      printf("%d\n", k / 2);
      for (i = 1; i <= n; ++i) f[i] = i;
      for (j = i + 1; j <= n; ++j)
        if (a[i][j]) f[find(vis[i])] = find(vis[j]);
      for (i = 1; i <= n; ++i)
        if (d[i] < 2)
          while (d[i] < 2) {
            for (j = i + 1; j <= n; ++j)
              if (d[j] < 2 && find(vis[i]) != find(vis[j])) break;
            if (j <= n) {
              printf("%d %d\n", i, j);
              ++d[i], ++d[j];
              f[find(vis[i])] = find(vis[j]);
            } else
              break;
          }
      for (i = 1; i <= n; ++i)
        if (d[i] < 2)
          while (d[i] < 2) {
            for (j = i + 1; j <= n; ++j)
              if (d[j] < 2) break;
            printf("%d %d\n", i, j);
            ++d[i], ++d[j];
            f[find(vis[i])] = find(vis[j]);
          }
    }
  }
  return 0;
}
