#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int G[50][50] = {0};
  int multiple = 0;
  int same = 0;
  for (int i = 0; i < m; i++) {
    int x1, y1;
    scanf("%d %d", &x1, &y1);
    G[x1 - 1][y1 - 1]++;
    if (x1 != y1) G[y1 - 1][x1 - 1]++;
    if (G[x1 - 1][y1 - 1] > 1) multiple++;
    if (x1 == y1) multiple++, same++;
  }
  if (n == 1) {
    if (G[0][0] == 1)
      printf("YES\n0\n");
    else if (G[0][0] == 0)
      printf("YES\n1\n1 1\n");
    else
      printf("NO\n");
    return 0;
  }
  if (same || (n != 2 && multiple) || (n == 2 && G[0][1] > 2)) {
    printf("NO\n");
    return 0;
  }
  int group[50] = {0};
  int group_num = 0;
  int ok = 1;
  int cycle_num = 0;
  int add[50][50] = {0};
  for (int i = 0; i < n; i++)
    if (!group[i]) {
      group_num++;
      queue<int> Q;
      Q.push(i);
      group[i] = 1;
      int edge_sum = 0;
      int vertex_sum = 0;
      int deg_1 = 0, deg_many = 0;
      while (!Q.empty()) {
        int now = Q.front();
        vertex_sum++;
        Q.pop();
        int deg = 0;
        for (int j = 0; j < n; j++)
          if (G[now][j]) {
            edge_sum += G[now][j], deg += G[now][j];
            if (!group[j]) {
              group[j] = group_num;
              Q.push(j);
            }
          }
        if (deg == 1) add[group_num - 1][deg_1++] = now;
        if (deg > 2) deg_many++;
      }
      if (vertex_sum == 1) {
        add[group_num - 1][0] = i;
        add[group_num - 1][1] = i;
      } else if (deg_many || (deg_1 == 0 && vertex_sum < n)) {
        printf("NO\n");
        return 0;
      } else if (deg_1 == 0)
        group_num--;
    }
  printf("YES\n");
  printf("%d\n", group_num);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int pick1 = -1;
      int pick2 = -1;
      for (int k = 0; k < group_num; k++)
        if (add[k][0] == i || add[k][1] == i) pick1 = k;
      for (int k = 0; k < group_num; k++)
        if (add[k][0] == j || add[k][1] == j) pick2 = k;
      if (pick1 == pick2 && group_num > 1) continue;
      if (pick1 == -1 || pick2 == -1) continue;
      printf("%d %d\n", i + 1, j + 1);
      if (add[pick1][0] == i) add[pick1][0] = add[pick1][1];
      if (add[pick2][0] == j)
        add[pick1][1] = add[pick2][1];
      else
        add[pick1][1] = add[pick2][0];
      add[pick2][0] = add[group_num - 1][0];
      add[pick2][1] = add[group_num - 1][1];
      group_num--;
      j--;
    }
  return 0;
}
