#include <bits/stdc++.h>
using namespace std;
const int maxn = 55;
int in[maxn], fa[maxn], e[2020][3], n, m, res, ans, top;
pair<int, int> ma[maxn];
inline int find(int x) {
  if (x == fa[x]) return x;
  return fa[x] = find(fa[x]);
}
inline int read() {
  int sum = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) sum = sum * 10 + (ch ^ 48), ch = getchar();
  return sum;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) {
    int u = read(), v = read();
    in[u]++, in[v]++;
    fa[find(u)] = find(v);
  }
  for (int i = 1; i <= n; i++)
    if (in[i] >= 3) return printf("NO\n"), 0;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      if (find(i) != find(j) && in[i] <= 1 && in[j] <= 1) {
        e[++top][1] = i, e[top][2] = j;
        in[i]++, in[j]++;
        fa[find(i)] = find(j);
      }
  if (m + top == n - 1) {
    top++;
    for (int i = 1; i <= n; i++)
      while (in[i] < 2) {
        in[i]++;
        if (!e[top][1])
          e[top][1] = i;
        else
          e[top][2] = i;
      }
  }
  for (int i = 1; i <= n; i++)
    if (find(i) != find(n)) return printf("NO\n"), 0;
  printf("YES\n");
  printf("%d\n", top);
  for (int i = 1; i <= top; i++) printf("%d %d\n", e[i][1], e[i][2]);
  return 0;
}
