#include <bits/stdc++.h>
using namespace std;
const int MN = 100;
int u[MN], st[MN], sm[MN][MN];
int n, m;
bool used[MN];
bool is_open[MN];
int up(int v) {
  if (u[v] == v) return v;
  return u[v] = up(u[v]);
}
void join(int x, int y) {
  x = up(x);
  y = up(y);
  if (rand() & 1)
    u[x] = y;
  else
    u[y] = x;
}
vector<pair<int, int> > vp;
void solve() {
  if (n == 1) {
    vp.push_back(make_pair(0, 0));
    return;
  }
  vp.reserve(n);
  bool f = true;
  while (f) {
    f = false;
    for (int i = 0; i < n - 1; i++)
      for (int j = i + 1; j < n; j++) {
        if (st[i] < 2 && st[j] < 2 && up(i) != up(j)) {
          join(i, j);
          st[i]++;
          st[j]++;
          vp.push_back(make_pair(i, j));
          f = true;
        }
      }
  }
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++)
      if (st[i] == 1 && st[j] == 1) {
        vp.push_back(make_pair(i, j));
        return;
      }
}
bool dfs(int v, int pr) {
  used[v] = true;
  is_open[v] = true;
  bool f = false;
  for (int i = 0; i < n; i++) {
    if (i == pr) continue;
    if (sm[v][i] && is_open[i]) f = true;
    if (sm[v][i] && !used[i]) f |= dfs(i, v);
  }
  is_open[v] = false;
  return f;
}
int main() {
  srand(time(0));
  bool f1 = true, f2 = false, f3 = false, f4 = true;
  cin >> n >> m;
  for (int i = 0; i < n; i++) u[i] = i;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    if (sm[x][y]) f3 = true;
    sm[x][y] = sm[y][x] = 1;
    st[x]++;
    st[y]++;
    join(x, y);
  }
  dfs(0, -1);
  for (int i = 0; i < n; i++) {
    f4 &= used[i];
    used[i] = false;
  }
  for (int i = 0; i < n; i++) {
    if (!used[i]) f3 |= dfs(i, -1);
    if (st[i] != 2) f1 = false;
    if (st[i] > 2) f2 = true;
  }
  if (n == m && f1 && f4) {
    cout << "YES\n0";
    return 0;
  }
  if (m >= n || f2 || f3) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  solve();
  cout << vp.size() << endl;
  for (int i = 0; i < vp.size(); i++)
    cout << vp[i].first + 1 << " " << vp[i].second + 1 << endl;
  return 0;
}
