#include <bits/stdc++.h>
const int MAXN = 50 + 1;
int lab[MAXN], deg[MAXN];
int n, m;
int root(int x) {
  for (; lab[x] > 0; x = lab[x])
    ;
  return x;
}
void merge(int x, int y) {
  int t = lab[x] + lab[y];
  if (lab[x] < lab[y]) {
    lab[y] = x;
    lab[x] = t;
  } else {
    lab[x] = y;
    lab[y] = t;
  }
}
int main() {
  int u, v;
  scanf("%d %d", &n, &m);
  if (m > n) {
    puts("NO");
    return 0;
  } else if (n == 1) {
    puts("YES");
    if (m == 1)
      puts("0");
    else {
      puts("1");
      puts("1 1");
    }
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    lab[i] = -1;
    deg[i] = 0;
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d %d", &u, &v);
    ++deg[u], ++deg[v];
    if (u == v || deg[u] > 2 || deg[v] > 2) {
      puts("NO");
      return 0;
    }
    int ru = root(u), rv = root(v);
    if (ru != rv)
      merge(ru, rv);
    else if (i + 1 < n) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  printf("%d\n", n - m);
  for (u = 1; u <= n; ++u)
    while (deg[u] < 2) {
      int ru = root(u);
      for (v = u + 1; v <= n; ++v)
        if (deg[v] < 2) {
          int rv = root(v);
          if (m + 1 == n || ru != rv) {
            merge(ru, rv);
            ++deg[u];
            ++deg[v];
            ++m;
            printf("%d %d\n", u, v);
            break;
          }
        }
    }
  return 0;
}
