#include <bits/stdc++.h>
using namespace std;
const int MAXN = 51;
vector<bool> visit;
vector<int> f, deg, edge[MAXN];
vector<pair<int, int> > ad;
void not_pos() {
  cout << "NO" << endl;
  exit(0);
}
void pos(int n) {
  cout << "YES" << endl;
  cout << n << endl;
  for (int i = 0; i < n; ++i)
    cout << ad[i].first << ' ' << ad[i].second << endl;
  exit(0);
}
int find(int i) {
  int s(i);
  while (f[i] != i) i = f[i];
  while (f[s] != s) {
    int t(f[s]);
    f[s] = i;
    s = t;
  }
  return s;
}
void merge(int i, int j) {
  int fa(find(i)), fb(find(j));
  if (fa != fb) f[fa] = fb;
}
int find_size(int p) {
  visit[p] = true;
  int sz(1);
  for (int i = 0; i < edge[p].size(); ++i)
    if (!visit[edge[p][i]]) sz += find_size(edge[p][i]);
  return sz;
}
bool find_circle(int p, int fa) {
  visit[p] = true;
  for (int i = 0; i < edge[p].size(); ++i)
    if (edge[p][i] != fa)
      if (visit[edge[p][i]])
        return true;
      else if (find_circle(edge[p][i], p))
        return true;
  return false;
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m > n) not_pos();
  ad.clear();
  if (n == 1) {
    if (!m) ad.push_back(make_pair(1, 1));
    pos(n - m);
  }
  deg.assign(n + 1, 0);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    if (a == b) not_pos();
    edge[a].push_back(b);
    edge[b].push_back(a);
    if (++deg[a] > 2) not_pos();
    if (++deg[b] > 2) not_pos();
  }
  visit.assign(n + 1, false);
  if (m == n)
    if (find_size(1) != n)
      not_pos();
    else
      pos(0);
  visit.assign(n + 1, false);
  for (int i = 1; i <= n; ++i)
    if (!visit[i] && find_circle(i, 0)) not_pos();
  f.assign(n + 1, 0);
  for (int i = 1; i <= n; ++i) f[i] = i;
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < edge[i].size(); ++j) merge(i, edge[i][j]);
  for (int k = m; k < n; ++k) {
    int i, j;
    for (i = 1; i < n; ++i)
      if (deg[i] < 2) break;
    for (j = i + 1; j <= n; ++j)
      if (deg[j] < 2 && (ad.size() == n - m - 1 || find(i) != find(j))) break;
    ad.push_back(make_pair(i, j));
    merge(i, j);
    ++deg[i];
    ++deg[j];
  }
  pos(n - m);
  return 0;
}
