#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, mod = 1000000007;
const double pi = 3.1415926535897932, eps = 1e-6;
void chmax(int &x, int y) {
  if (x < y) x = y;
}
void chmin(int &x, int y) {
  if (x > y) x = y;
}
int qpow(int x, int y) {
  int ret = 1;
  while (y) {
    if (y & 1) ret = (long long)ret * x % mod;
    x = (long long)x * x % mod;
    y >>= 1;
  }
  return ret;
}
int n, m, X[2505], Y[2505];
int fa[55], num[55], siz[55];
vector<int> v[55];
int find(int x) {
  if (x == fa[x]) return x;
  return fa[x] = find(fa[x]);
}
void unite(int x, int y) {
  int xx = find(x), yy = find(y);
  if (xx == yy) return;
  siz[yy] += siz[xx];
  siz[xx] = 0;
  fa[xx] = yy;
}
bool vis[55];
vector<int> cc[55];
vector<pair<int, int> > chains, nw, ans;
int adj[55][55];
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = (1); (i) <= (n); (i)++) fa[i] = i, siz[i] = 1;
  for (int(i) = (1); (i) <= (m); (i)++) {
    int t1, t2;
    scanf("%d%d", &t1, &t2);
    unite(t1, t2);
    v[t1].push_back(t2);
    v[t2].push_back(t1);
    adj[t1][t2]++;
    adj[t2][t1]++;
    X[i] = t1;
    Y[i] = t2;
  }
  for (int(i) = (1); (i) <= (n); (i)++)
    if (v[i].size() > 2) {
      puts("NO");
      return 0;
    }
  for (int(i) = (1); (i) <= (m); (i)++) num[find(X[i])]++;
  for (int(i) = (1); (i) <= (n); (i)++)
    if (num[find(i)] > siz[find(i)]) {
      puts("NO");
      return 0;
    }
  for (int(i) = (1); (i) <= (n); (i)++) cc[find(i)].push_back(i);
  int R = 0;
  for (int(i) = (1); (i) <= (n); (i)++)
    if (cc[i].size()) {
      if (num[i] == cc[i].size()) {
        R++;
        if (siz[i] > 2) {
          for (int(j) = (0); (j) < (siz[i]); (j)++)
            for (int(k) = (j + 1); (k) < (siz[i]); (k)++)
              if (adj[cc[i][j]][cc[i][k]] > 1) {
                puts("NO");
                return 0;
              }
        }
        continue;
      }
      vector<int> ends;
      for (int(j) = (0); (j) < (cc[i].size()); (j)++)
        if (v[cc[i][j]].size() <= 1) ends.push_back(cc[i][j]);
      if (ends.size() > 2) {
        puts("NO");
        return 0;
      }
      chains.push_back(make_pair(ends.front(), ends.back()));
    }
  if ((!!chains.size() + R) > 1) {
    puts("NO");
    return 0;
  }
  for (int(i) = (0); (i) < (chains.size()); (i)++)
    if (chains[i].second < chains[i].first)
      swap(chains[i].second, chains[i].first);
  for (int(i) = (1); (i) <= (n - m - 1); (i)++) {
    int S1 = 0, S2 = 0;
    pair<int, int> t = make_pair(inf, inf);
    for (int(j) = (0); (j) < (chains.size()); (j)++) {
      for (int(k) = (j + 1); (k) < (chains.size()); (k)++) {
        pair<int, int> now = make_pair(chains[j].first, chains[k].first);
        if (now.first > now.second) swap(now.first, now.second);
        if (t > now) {
          t = now;
          S1 = j;
          S2 = k;
        }
      }
    }
    nw.clear();
    for (int(j) = (0); (j) < (chains.size()); (j)++)
      if (j != S1 && j != S2) nw.push_back(chains[j]);
    pair<int, int> add = make_pair(chains[S1].second, chains[S2].second);
    if (add.first > add.second) swap(add.first, add.second);
    nw.push_back(add);
    ans.push_back(t);
    chains = nw;
  }
  if (chains.size())
    ans.push_back(make_pair(chains.front().first, chains.front().second));
  puts("YES");
  printf("%d\n", ans.size());
  for (int(i) = (0); (i) < (ans.size()); (i)++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
