#include <bits/stdc++.h>
using namespace std;
const int N = 55;
struct MFS {
  int fa[N];
  void init() {
    for (int i = 0; i < N; ++i) fa[i] = i;
  }
  int find(int x) { return fa[x] = fa[x] == x ? x : find(fa[x]); }
  bool merge(int x, int y) {
    int fx = find(x);
    int fy = find(y);
    if (fx == fy) return 0;
    fa[fx] = fy;
    return 1;
  }
} mfs;
int run() {
  int n, m, x, y;
  while (cin >> n >> m) {
    mfs.init();
    vector<int> in(n + 1, 2);
    bool ok = n >= m;
    for (int i = 1; i <= m; ++i) {
      cin >> x >> y;
      --in[x], --in[y];
      if (in[x] < 0 || in[y] < 0) ok = 0;
      if (mfs.find(x) == mfs.find(y) && i != n) ok = 0;
      mfs.merge(x, y);
    }
    if (ok) {
      cout << "YES" << endl << n - m << endl;
      for (int i = 1; i <= n; ++i) {
        for (int t = 0; t < 2; ++t) {
          for (int j = i + 1; j <= n; ++j) {
            if (in[i] && in[j] && mfs.merge(i, j)) {
              --in[i], --in[j];
              cout << i << ' ' << j << endl;
            }
          }
        }
      }
      int c = 2;
      for (int i = 1; i <= n; ++i) {
        while (in[i]--) {
          cout << i;
          --c;
          if (c)
            cout.put(' ');
          else {
            c = 2;
            cout << endl;
          }
        }
      }
    } else
      cout << "NO" << endl;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  return run();
}
