#include <bits/stdc++.h>
using namespace std;
int n, m, col;
vector<vector<int> > g;
vector<int> used, p;
bool cycle = false;
void dfs(int v, int col) {
  used[v] = col;
  for (int i = 0; i < g[v].size(); ++i) {
    int to = g[v][i];
    if (used[to] == 0) {
      p[to] = v;
      dfs(to, col);
    } else if (p[v] != to)
      cycle = true;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  g.resize(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  if (m > n) {
    cout << "NO\n";
    return 0;
  }
  if (n == 1) {
    if (m == 0)
      cout << "YES\n"
           << "1\n"
           << "1 1\n";
    else
      cout << "YES\n"
           << "0\n";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < g[i].size(); ++j)
      if (g[i][j] == i) {
        cout << "NO" << endl;
        return 0;
      }
  }
  if (n == 2) {
    if (m == 0)
      cout << "YES\n"
           << "2\n"
           << "1 2\n"
           << "1 2\n";
    else if (m == 1)
      cout << "YES\n"
           << "1\n"
           << "1 2\n";
    else
      cout << "YES\n"
           << "0\n";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < g[i].size(); ++j)
      for (int l = 0; l < j; ++l)
        if (g[i][j] == g[i][l]) {
          cout << "NO" << endl;
          return 0;
        }
  }
  for (int i = 0; i < n; ++i)
    if (g[i].size() > 2) {
      cout << "NO\n";
      return 0;
    }
  used.assign(n, 0);
  p.assign(n, -1);
  bool fl = true;
  col = 1;
  for (int i = 0; i < n; ++i)
    if (used[i] == 0) dfs(i, col++);
  for (int i = 0; i < n; ++i)
    if (g[i].size() != 2) fl = false;
  if (fl && col == 2) {
    cout << "YES\n 0\n";
    return 0;
  }
  if (cycle) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n" << n - m << endl;
  for (int q = 0; q < n - m - 1; ++q) {
    int a = 0;
    while (g[a].size() == 2) ++a;
    int b = a + 1;
    while (!(g[b].size() < 2 && used[b] != used[a])) ++b;
    cout << a + 1 << " " << b + 1 << endl;
    g[a].push_back(b);
    g[b].push_back(a);
    int col_fr = used[b];
    int col_to = used[a];
    for (int i = 0; i < n; ++i)
      if (used[i] == col_fr) used[i] = col_to;
  }
  vector<int> w;
  for (int i = 0; i < n; ++i)
    if (g[i].size() == 1) w.push_back(i + 1);
  sort(w.begin(), w.end());
  cout << w[0] << " " << w[1] << endl;
  return 0;
}
