#include <bits/stdc++.h>
using namespace std;
struct node {
  int parent;
  int ranks;
  int d;
};
const int MAX = 55, MAX1 = 2505;
node trees[MAX];
int n, m, i, j, k, b[MAX], c[MAX], x, y, edge[MAX1][2];
bool flag = true;
void inis() {
  for (i = 1; i <= n; i++)
    trees[i].parent = i, trees[i].ranks = 0, trees[i].d = 0;
}
int findSet(int x) {
  if (trees[x].parent != x)
    return trees[x].parent = findSet(trees[x].parent);
  else
    return x;
}
void unions(int x, int y) {
  int rootX = findSet(x), rootY = findSet(y);
  if (rootX == rootY) return;
  if (trees[rootX].ranks > trees[rootY].ranks) swap(rootX, rootY);
  trees[rootX].parent = rootY;
  if (trees[rootX].ranks == trees[rootY].ranks) trees[rootY].ranks++;
}
int main() {
  scanf("%d%d", &n, &m);
  inis();
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &edge[i][0], &edge[i][1]);
    trees[edge[i][0]].d++, trees[edge[i][1]].d++;
    if (trees[edge[i][0]].d > 2 || trees[edge[i][1]].d > 2) flag = false;
  }
  for (i = 1; i <= n; i++)
    b[i] = (trees[i].d == 1 ? 1 : 0), c[i] = (trees[i].d == 2 ? 1 : 0);
  for (i = 1; i <= m; i++) {
    int x = edge[i][0], y = edge[i][1];
    int rootX = findSet(x), rootY = findSet(y);
    if (rootX == rootY) continue;
    if (trees[rootX].ranks > trees[rootY].ranks) swap(rootX, rootY);
    trees[rootX].parent = rootY, b[rootY] += b[rootX], c[rootY] += c[rootX];
    if (trees[rootX].ranks == trees[rootY].ranks) trees[rootY].ranks++;
  }
  for (k = 0, i = 1; i <= n; i++)
    if (trees[i].parent == i) k++;
  for (i = 1; i <= n; i++)
    if (trees[i].parent == i && c[i] != 0 && b[i] == 0 && k != 1) flag = false;
  if (flag) {
    printf("YES\n%d\n", n - m);
    for (i = 1; i <= n; i++)
      for (k = 1; k <= 2; k++)
        for (j = i + 1; j <= n; j++) {
          int rootI = findSet(i), rootJ = findSet(j);
          if (trees[i].d < 2 && trees[j].d < 2 && rootI != rootJ) {
            unions(i, j);
            trees[i].d++, trees[j].d++;
            printf("%d %d\n", i, j);
          }
        }
    for (i = 1; i <= n; i++) {
      while (trees[i].d < 2) {
        printf("%d ", i);
        trees[i].d++;
      }
    }
  } else
    printf("NO\n");
  return 0;
}
