#include <bits/stdc++.h>
using namespace std;
const int maxn = 50 + 2;
vector<int> v[maxn];
int a[maxn][maxn];
vector<vector<int> > components;
vector<pair<int, int> > ans;
int n, m;
int d[maxn];
vector<int> q;
int vis[maxn];
int cur = 0;
inline void dfs(int start) {
  vis[start] = cur;
  for (int i = 0; i < v[start].size(); ++i)
    if (vis[v[start][i]] == 0) dfs(v[start][i]);
  q.push_back(start);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int v1, v2;
    cin >> v1 >> v2;
    v[v1].push_back(v2);
    v[v2].push_back(v1);
    d[v1]++;
    d[v2]++;
    a[v1][v2]++;
    a[v2][v1]++;
  }
  if (n == 1) {
    if (m > 1)
      cout << "NO" << endl;
    else if (m == 1)
      cout << "YES" << endl << 0 << endl;
    else
      cout << "YES" << endl << 1 << endl << 1 << " " << 1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    if (a[i][i] > 0) {
      cout << "NO" << endl;
      return 0;
    }
  if (n == 2) {
    if (m > 2)
      cout << "NO" << endl;
    else if (m == 2)
      cout << "YES" << endl << 0 << endl;
    else if (m == 1)
      cout << "YES" << endl << 1 << endl << 1 << " " << 2 << endl;
    else
      cout << "YES" << endl
           << 2 << endl
           << 1 << " " << 2 << endl
           << 1 << " " << 2 << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (a[i][j] > 1) {
        cout << "NO" << endl;
        return 0;
      }
  for (int i = 1; i <= n; ++i)
    if (d[i] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  for (int i = 1; i <= n; ++i)
    if (vis[i] == 0) {
      cur++;
      q.resize(0);
      dfs(i);
      components.push_back(q);
    }
  for (int i = 0; i < components.size(); ++i) {
    int cnt = 0;
    for (int j = 0; j < components[i].size(); ++j) cnt += d[components[i][j]];
    cnt /= 2;
    if (cnt >= components[i].size() && components.size() > 1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  while (components.size() > 1) {
    int Min1, Min2;
    for (int i = 1; i <= n; ++i)
      if (d[i] <= 1) {
        Min1 = i;
        d[i]++;
        break;
      }
    for (int i = 1; i <= n; ++i)
      if (d[i] <= 1 && vis[i] != vis[Min1]) {
        Min2 = i;
        d[i]++;
        break;
      }
    ans.push_back(pair<int, int>(Min1, Min2));
    int cp = vis[Min2];
    components.pop_back();
    for (int i = 1; i <= n; ++i)
      if (vis[i] == cp) vis[i] = vis[Min1];
  }
  for (int i = 1; i <= n; ++i)
    if (d[i] <= 1)
      for (int j = i + 1; j <= n; ++j)
        if (d[j] <= 1) {
          d[i]++;
          d[j]++;
          ans.push_back(pair<int, int>(i, j));
        }
  cout << "YES" << endl;
  cout << ans.size() << endl;
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); ++i)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
