#include <bits/stdc++.h>
using namespace std;
const int DIM = 55;
int cnt[DIM], fth[DIM];
int getRoot(int x) {
  while (fth[x] > 0) x = fth[x];
  return x;
}
int _n;
void unite(int x, int y) {
  int xx = x, yy = y;
  x = getRoot(x);
  y = getRoot(y);
  if (x == y) {
    if (!(fth[x] == -_n)) {
      cout << "NO\n";
      exit(0);
    }
  }
  if (!(fth[x] == -_n)) {
    fth[y] += fth[x];
    fth[x] = y;
  }
}
int main(void) {
  int n, m;
  cin >> n >> m;
  _n = n;
  if (n == 1) {
    if (m == 0)
      cout << "YES\n1\n1 1\n";
    else if (m == 1)
      cout << "YES\n0\n";
    else
      cout << "NO\n";
    return 0;
  }
  for (int i = 1; i <= n; ++i) fth[i] = -1;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    if (x == y) {
      cout << "NO\n";
      return 0;
    }
    ++cnt[x];
    ++cnt[y];
    unite(x, y);
  }
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] > 2) {
      cout << "NO\n";
      return 0;
    }
  }
  vector<pair<int, int>> ans;
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      while (true) {
        int x = getRoot(i), y = getRoot(j);
        if (cnt[i] < 2 && cnt[j] < 2 && x != y) {
          unite(i, j);
          ++cnt[i];
          ++cnt[j];
          ans.push_back(make_pair(i, j));
        } else if (cnt[i] == 1 && cnt[j] == 1 && x == y && fth[x] == -n) {
          ++cnt[i];
          ++cnt[j];
          ans.push_back(make_pair(i, j));
        } else
          break;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] != 2) {
      cout << "NO\n";
      return 0;
    }
  }
  if (fth[getRoot(1)] != -n) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n" << ans.size() << "\n";
  for (auto pr : ans) cout << pr.first << " " << pr.second << "\n";
  return 0;
}
