#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, x, y, P[502], a[502], st;
int p(int u) {
  if (P[u] == u) return u;
  P[u] = p(P[u]);
  return P[u];
}
void uni(int x, int y) { P[p(x)] = p(y); }
int main() {
  cin >> n >> m;
  if (m > n) {
    cout << "NO" << endl;
    return 0;
  }
  for (i = 1; i <= n; i++) P[i] = i;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    a[x]++;
    a[y]++;
    if (p(x) == p(y) && (i != n)) {
      cout << "NO" << endl;
      return 0;
    }
    uni(x, y);
  }
  for (i = 1; i <= n; i++)
    if (a[i] > 2) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "YES" << endl;
  cout << n - m << endl;
  for (i = 1; i <= n; i++)
    while (a[i] < 2) {
      st = i + (n != 1);
      for (j = st; j <= n; j++)
        if (a[j] < 2 && (n <= 2 || (m + 1 == n) || p(i) != p(j))) {
          cout << i << " " << j << endl;
          m++;
          a[i]++;
          a[j]++;
          uni(i, j);
          break;
        }
    }
}
