#include <bits/stdc++.h>
using namespace std;
int N, M;
bool visit[51];
int d[51];
int g[51][51];
int first, second, cnt, num = 0;
map<int, int> mymap;
void dfs(int u) {
  visit[u] = 1;
  cnt++;
  if (d[u] == 0) {
    first = second = u;
    return;
  }
  if (d[u] == 1) {
    if (!first)
      first = u;
    else
      second = u;
  }
  for (int i = 1; i < N + 1; ++i) {
    if (!visit[i] && g[u][i]) dfs(i);
  }
}
int main() {
  cin >> N >> M;
  int x, y;
  bool d3 = false, ok = true;
  for (int i = 0; i < M; ++i) {
    cin >> x >> y;
    d[x]++;
    if (d[x] == 3) d3 = true;
    d[y]++;
    if (d[y] == 3) d3 = true;
    g[x][y]++;
    g[y][x]++;
  }
  if (d3) {
    cout << "NO" << endl;
    return 0;
  }
  num = 0;
  for (int i = 1; i < N + 1; ++i) {
    if (!visit[i]) {
      num++;
      first = second = cnt = 0;
      dfs(i);
      if (!first && !second) {
        if (cnt < N) ok = false;
      } else if (first * second == 0)
        ok = false;
      else if (first < second)
        mymap[first] = second;
      else
        mymap[second] = first;
    }
  }
  if (!ok) {
    cout << "NO" << endl;
    return 0;
  } else
    cout << "YES" << endl;
  cout << mymap.size() << endl;
  while (mymap.size() > 1) {
    int a = mymap.begin()->first;
    int b = (++mymap.begin())->first;
    cout << a << " " << b << endl;
    first = mymap[a];
    second = mymap[b];
    mymap.erase(mymap.begin());
    mymap.erase(mymap.begin());
    if (first < second)
      mymap[first] = second;
    else
      mymap[second] = first;
  }
  if (mymap.size() == 1) {
    cout << mymap.begin()->first << " " << mymap.begin()->second << endl;
  }
  return 0;
}
