#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(const T& e) {
  cout << e << endl;
}
template <class T1, class T2>
void debug(const T1& e1, const T2& e2) {
  cout << e1 << "  " << e2 << endl;
}
template <class T1, class T2, class T3>
void debug(const T1& e1, const T2& e2, const T3& e3) {
  cout << e1 << "  " << e2 << "  " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void debug(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
  cout << e1 << "  " << e2 << "  " << e3 << "  " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void debug(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
           const T5& e5) {
  cout << e1 << "  " << e2 << "  " << e3 << "  " << e4 << "  " << e5 << endl;
}
template <class T>
void debug(vector<T>& e) {
  int i;
  for (i = 0; i < (int)e.size(); i++) cout << e[i] << " ";
  cout << endl;
}
template <class T>
void debug(vector<basic_string<T> >& e) {
  int i, j;
  for (i = 0; i < (int)e.size(); i++) {
    for (j = 0; j < (int)e[i].size(); j++) cout << e[i][j];
    cout << endl;
  }
  cout << endl;
}
template <class T>
void debug(T e[100][100], int row, int col) {
  int i, j;
  for (i = 0; i < row; i++) {
    for (j = 0; j < col; j++) cout << e[i][j] << " ";
    cout << endl;
  }
}
long long Pow(long long B, long long P) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) R = (R * B);
    P /= 2;
    B = (B * B);
  }
  return R;
}
vector<int> adj[100], temp(100);
int mat[100][100], N, CHECK, id[100], cnt;
bool color[100];
void dfs(int u, int depth);
int main() {
  int i, j, k, l, val, test, Case = 1, nodes, edges, u, v;
  while (scanf("%d %d", &nodes, &edges) == 2) {
    CHECK = 0;
    for (i = 0; i < nodes + 1; i++) adj[i].clear();
    memset(mat, 0, sizeof(mat));
    for (i = 0; i < edges; i++) {
      scanf("%d %d", &u, &v);
      if (u == v) CHECK = 1;
      mat[u][v]++;
      mat[v][u]++;
      adj[u].push_back(v);
      adj[v].push_back(u);
      if ((int)adj[u].size() > 2) CHECK = 1;
      if ((int)adj[v].size() > 2) CHECK = 1;
    }
    memset(color, false, sizeof(color));
    temp.clear();
    N = nodes;
    if (nodes == 1) {
      if (edges == 1)
        printf("YES\n0\n");
      else if (edges == 0)
        printf("YES\n1\n1 1\n");
      else
        printf("NO\n");
      continue;
    }
    if (!CHECK) {
      cnt = 0;
      for (i = 1; i < nodes + 1; i++)
        if (color[i] == false) {
          cnt++;
          dfs(i, 0);
        }
    }
    if (edges > nodes) CHECK = 1;
    if (CHECK == 1) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    printf("%d\n", nodes - edges);
    for (k = edges; k < nodes; k++) {
      for (i = 1; i < nodes + 1; i++)
        if ((int)adj[i].size() < 2) break;
      for (j = i + 1; j < nodes + 1; j++)
        if ((int)adj[j].size() < 2 && (id[i] != id[j] || (k + 1 == nodes)))
          break;
      adj[i].push_back(j);
      adj[j].push_back(i);
      printf("%d %d\n", i, j);
      val = id[j];
      for (l = 1; l < nodes + 1; l++)
        if (id[l] == val) id[l] = id[i];
    }
  }
  return 0;
}
void dfs(int u, int depth) {
  color[u] = true;
  id[u] = cnt;
  temp[depth] = u;
  int i, v;
  for (i = 1; i < N + 1; i++) {
    if (mat[u][i]) {
      v = i;
      if (color[v] == false)
        dfs(v, depth + 1);
      else if (mat[u][v] == 2) {
        if (!(temp[0] == v && depth == N - 1)) {
          CHECK = 1;
          return;
        }
      }
    }
  }
}
