#include <bits/stdc++.h>
using namespace std;
int fa[100005];
void makeSet(int x) {
  for (int i = 1; i <= x; i++) fa[i] = i;
}
int findSet(int x) {
  if (x == fa[x]) return x;
  fa[x] = findSet(fa[x]);
  return fa[x];
}
int d[100005];
vector<pair<int, int> > ans;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  if (m > n) return printf("NO") & 0;
  if (n == 1 && m == 0) return printf("YES\n1\n1 1") & 0;
  if (n == 2 && m == 0) return printf("YES\n2\n1 2\n1 2") & 0;
  makeSet(n);
  int p = n;
  bool flag = 0;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    d[u]++, d[v]++;
    if (d[u] > 2 || d[v] > 2) return printf("NO") & 0;
    if (findSet(u) != findSet(v))
      fa[findSet(u)] = findSet(v), p--;
    else
      flag = 1;
  }
  if (flag == 1 && p != 1) return printf("NO") & 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (d[i] < 2 && d[j] < 2 && (findSet(i) != findSet(j) || p == 1)) {
        p--;
        fa[findSet(i)] = findSet(j);
        d[i]++, d[j]++;
        ans.push_back(make_pair(i, j));
      }
    }
  }
  printf("YES\n%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
