#include <bits/stdc++.h>
using namespace std;
int n, m, wcnt, mllen;
vector<vector<int>> g;
vector<int> used, anc, depth;
vector<pair<int, int>> res;
int fanc(int x) {
  if (x != anc[x]) {
    int top = fanc(anc[x]);
    anc[x] = top;
    return top;
  }
  return x;
}
void dfs(int x, int from, int dep, int top) {
  used[x] = 1;
  anc[x] = top;
  depth[x] = dep;
  bool back = true;
  int idx;
  for (int i = 0; i < g[x].size(); i++) {
    idx = g[x][i];
    if (!used[idx])
      dfs(idx, x, dep + 1, top);
    else if (idx == from) {
      if (back)
        back = false;
      else {
        int now = abs(dep - depth[idx]) + 1;
        if (now == n) wcnt++;
        mllen = min(mllen, now);
      }
    } else {
      int now = abs(dep - depth[idx]) + 1;
      if (now == n) wcnt++;
      mllen = min(mllen, now);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  wcnt = 0, mllen = 51;
  g = vector<vector<int>>(n, vector<int>());
  used = anc = depth = vector<int>(n);
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    --x, --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 0; i < n; i++) {
    if (used[i] == 0) dfs(i, -1, 0, i);
  }
  if (mllen < n)
    cout << "NO" << endl;
  else if (mllen == n && wcnt > 2)
    cout << "NO" << endl;
  else {
    int left = 2 * n;
    bool bad = false;
    for (int i = 0; i < n; i++) {
      used[i] = g[i].size();
      if (used[i] > 2) bad = true;
      left -= used[i];
    }
    if (bad) {
      cout << "NO" << endl;
      return 0;
    }
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      if (left <= 2) break;
      while (true) {
        if (used[i] >= 2 || left <= 2) break;
        for (int j = i + 1; j < n; j++) {
          if (used[j] < 2 && fanc(i) != fanc(j)) {
            res.push_back({i, j});
            ++used[i];
            ++used[j];
            anc[anc[i]] = anc[anc[j]] = min(anc[i], anc[j]);
            left -= 2;
            break;
          }
        }
      }
    }
    for (int i = 0; i < n; i++) {
      if (used[i] < 2) {
        used[i]++;
        for (int j = i; j < n; j++) {
          if (used[j] < 2) {
            res.push_back({i, j});
            break;
          }
        }
        break;
      }
    }
    cout << res.size() << endl;
    for (int i = 0; i < res.size(); i++) {
      cout << res[i].first + 1 << " " << res[i].second + 1 << endl;
    }
  }
  return 0;
}
