#include <bits/stdc++.h>
using namespace std;
ifstream fin("a.in");
int edge[51][51];
bool checked[51];
int group[51];
int link[51];
vector<int> groupList[51];
int n, m, groups;
vector<pair<int, int> > addedEdges;
void createGroup(int poz) {
  groupList[groups].push_back(poz);
  group[poz] = groups;
  for (int i = 1; i <= n; i++) {
    if (edge[poz][i] != 0 && !group[i]) {
      createGroup(i);
    }
  }
}
bool createLoop(int poz, int prev) {
  checked[poz] = true;
  bool sw = true;
  for (int i = 1; i <= n; i++) {
    if ((edge[poz][i] != 0 && prev != i) || edge[poz][i] > 1) {
      if (checked[i])
        return false;
      else {
        sw &= createLoop(i, poz);
      }
    }
  }
  return sw;
  checked[poz] = false;
}
void joinGroup(int one, int two) {
  int i;
  for (i = 0; i < groupList[two].size(); i++) {
    group[groupList[two][i]] = one;
    groupList[one].push_back(groupList[two][i]);
  }
}
int main() {
  cin >> n >> m;
  if (m > n) {
    cout << "NO";
    return 0;
  }
  int i, j, l, x, y;
  int m2 = m;
  for (i = 0; i < m2; i++) {
    cin >> x >> y;
    edge[x][y]++;
    edge[y][x]++;
    link[x]++;
    link[y]++;
    if (link[x] == 3 || link[y] == 3) {
      cout << "NO";
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    if (!group[i]) {
      groups++;
      createGroup(i);
    }
  }
  if (n == m && groups == 1) {
    cout << "YES\n0";
    return 0;
  }
  int sw = true;
  for (i = 1; i <= groups; i++) {
    sw &= createLoop(groupList[i][0], 0);
  }
  if (!sw) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  cout << n - m;
  if (n == 1 && n - m == 1) {
    cout << '\n' << 1 << ' ' << 1;
    return 0;
  }
  for (i = 0; i < n - m; i++) {
    for (j = 1; j <= n; j++) {
      if (link[j] < 2) {
        for (l = j + 1; l <= n; l++) {
          if (link[j] < 2 && link[l] < 2 &&
              (group[j] != group[l] || groups == 1)) {
            link[j]++;
            link[l]++;
            if (group[j] != group[l]) {
              joinGroup(group[j], group[l]);
              groups--;
            }
            addedEdges.push_back(make_pair(j, l));
          }
        }
      }
    }
  }
  for (i = 0; i < n - m; i++) {
    cout << '\n' << addedEdges[i].first << ' ' << addedEdges[i].second;
  }
  return 0;
}
