#include <bits/stdc++.h>
using namespace std;
int uf[55];
int buc[55];
bool chk[55];
int ans[5000][2];
int fh(int idx) {
  if (uf[idx] != idx) uf[idx] = fh(uf[idx]);
  return uf[idx];
}
vector<int> edge[55];
void dfs(int idx) {
  if (chk[idx]) return;
  chk[idx] = true;
  for (int i = 0; i < edge[idx].size(); i++) {
    dfs(edge[idx][i]);
  }
}
int main() {
  int n, m, g1, g2;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    uf[i] = i;
  }
  bool b = true;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &g1, &g2);
    edge[g1].push_back(g2);
    edge[g2].push_back(g1);
    buc[g1]++;
    buc[g2]++;
    if (uf[g1] == uf[g2]) {
      b = false;
    }
    uf[fh(g1)] = fh(g2);
  }
  if (n == 1) {
    if (m == 0) {
      printf("YES\n1\n1 1");
    } else if (m == 1) {
      printf("YES\n0");
    } else {
      printf("NO");
    }
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (buc[i] > 2) {
      printf("NO");
      return 0;
    }
  }
  if (!b) {
    dfs(1);
    for (int i = 1; i <= n; i++) {
      if (!chk[i]) {
        printf("NO");
        return 0;
      }
    }
    printf("YES\n0");
    return 0;
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (fh(i) != fh(j) && buc[i] != 2 && buc[j] != 2) {
        ans[cnt][0] = i;
        ans[cnt][1] = j;
        uf[fh(i)] = fh(j);
        buc[i]++;
        buc[j]++;
        cnt++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (buc[i] != 2) {
      for (int j = i + 1; j <= n; j++) {
        if (buc[j] != 2) {
          ans[cnt][0] = i;
          ans[cnt][1] = j;
          cnt++;
          break;
        }
      }
      break;
    }
  }
  printf("YES\n");
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) {
    printf("%d %d\n", ans[i][0], ans[i][1]);
  }
}
