#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:16000000")
#pragma warning(disable : 4996)
const int inf = 1 << 25;
const double eps = 1e-9;
const int MAXN = 55;
int deg[MAXN];
vector<vector<int> > comps;
bool visited[MAXN];
vector<int> adj[MAXN];
int n, m;
void dfs(int u) {
  if (visited[u]) return;
  comps.back().push_back(u);
  visited[u] = true;
  for (int i = (0); i < ((int)adj[u].size()); ++i) {
    int v = adj[u][i];
    dfs(v);
  }
}
void no() {
  printf("NO\n");
  exit(0);
}
int main() {
  cin >> n >> m;
  memset((deg), (0), sizeof(deg));
  for (int i = (0); i < (m); ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    deg[u]++, deg[v]++;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  memset((visited), (false), sizeof(visited));
  for (int i = (0); i < (n); ++i)
    if (!visited[i]) {
      comps.push_back(vector<int>());
      dfs(i);
    }
  vector<vector<int> > ends(comps.size());
  bool ok = true;
  for (int i = (0); i < ((int)comps.size()); ++i) {
    for (int j = (0); j < ((int)comps[i].size()); ++j) {
      int u = comps[i][j];
      if (deg[u] < 2) ends[i].push_back(u);
      if (deg[u] > 2) ok = false;
    }
  }
  if (!ok) no();
  for (int i = (0); i < ((int)ends.size()); ++i) {
    if (ends[i].empty()) {
      if (ends.size() == 1)
        printf("YES\n0\n");
      else
        no();
      return 0;
    }
    if (ends[i].size() > 2) throw 0;
    if (ends[i].size() == 1) ends[i].push_back(ends[i].front());
  }
  for (int i = (0); i < ((int)ends.size()); ++i)
    sort(ends[i].begin(), ends[i].end());
  sort(ends.begin(), ends.end());
  printf("YES\n");
  set<pair<int, int> > X;
  for (int i = (0); i < ((int)ends.size()); ++i)
    X.insert(pair<int, int>(ends[i][0], ends[i][1]));
  cout << X.size() << endl;
  while (X.size() > 1) {
    pair<int, int> A = *X.begin(), B = *(++X.begin());
    X.erase(A), X.erase(B);
    printf("%d %d\n", A.first + 1, B.first + 1);
    pair<int, int> C(A.second, B.second);
    if (C.first > C.second) swap(C.first, C.second);
    X.insert(C);
  }
  printf("%d %d\n", X.begin()->first + 1, X.begin()->second + 1);
  return 0;
}
