#include <bits/stdc++.h>
using namespace std;
ifstream fin("INPUT.txt");
ofstream fout("OUTPUT.txt");
const int N = 305;
const int M = 20;
const long long INF = 1e18 + 1;
int mod = 1000000007;
int n, m, k, h, x, y;
vector<int> v[N];
int used[N] = {0};
bool is_c = false;
void dfs(int k, int p = -1) {
  used[k] = 1;
  for (int i = 0; i < v[k].size(); i++) {
    if (used[v[k][i]] == 0)
      dfs(v[k][i], k);
    else if (v[k][i] != p && used[v[k][i]] == 1)
      is_c = true;
    if (v[k][i] == p) p = -1;
  }
  used[k] = 2;
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    v[x - 1].push_back(y - 1);
    v[y - 1].push_back(x - 1);
  }
  int count = 0, Max = 0;
  for (int i = 0; i < n; i++) {
    Max = max(Max, int(v[i].size()));
    if (used[i] == 0) {
      count++;
      dfs(i);
    }
  }
  count = (count == 1);
  Max = (Max < 3);
  if (count && n == m && Max) {
    cout << "YES" << endl << 0 << endl;
    return 0;
  }
  if (!Max || m > n || is_c) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl << n - m << endl;
  vector<pair<int, int> > ans;
  if (n == 1) {
    cout << 1 << ' ' << 1;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (v[i].size() == 2) continue;
    fill(used, used + n, 0);
    dfs(i);
    int Min = 0;
    for (int i = 0; i < n; i++)
      if (used[i] && v[i].size() != 2) {
        Min = i;
        break;
      }
    for (int j = 0; j < n; j++)
      if (used[j] == 0 && v[j].size() < 2) {
        ans.push_back(make_pair(min(Min, j), max(Min, j)));
        v[Min].push_back(j);
        v[j].push_back(Min);
        break;
      }
  }
  for (int i = 0; i < n; i++) {
    if (v[i].size() != 2)
      for (int j = 0; j < n; j++)
        if (v[j].size() != 2 && i != j) {
          ans.push_back(make_pair(i, j));
          v[i].push_back(j);
          v[j].push_back(i);
          break;
        }
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first + 1 << ' ' << ans[i].second + 1 << endl;
  return 0;
}
