#include <bits/stdc++.h>
using namespace std;
const int maxn = 60;
vector<int> adj[maxn];
int n, m;
void read() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
}
bool vis[maxn];
vector<int> ch;
void dfs(int v) {
  vis[v] = 1;
  ch.push_back(v);
  for (int i = 0; i < int(adj[v].size()); i++) {
    int nxt = adj[v][i];
    if (!vis[nxt]) dfs(nxt);
  }
}
void solve() {
  memset(vis, 0, sizeof(vis));
  if (m > n) {
    puts("NO");
    return;
  } else if (m == n) {
    dfs(0);
    for (int i = 0; i < n; i++) {
      if (!vis[i] || int(adj[i].size()) != 2) {
        puts("NO");
        return;
      }
    }
    puts("YES\n0");
    return;
  } else {
    for (int i = 0; i < n; i++) {
      if (int(adj[i].size()) > 2) {
        puts("NO");
        return;
      }
    }
    set<pair<int, int> > line;
    for (int i = 0; i < n; i++) {
      if (vis[i]) continue;
      if (int(adj[i].size()) == 0) {
        line.insert(make_pair(i, i));
        vis[i] = 1;
      }
      if (int(adj[i].size()) == 1) {
        ch.clear();
        dfs(i);
        line.insert(make_pair(ch.front(), ch.back()));
      }
    }
    for (int i = 0; i < n; i++) {
      if (!vis[i]) {
        puts("NO");
        return;
      }
    }
    vector<pair<int, int> > ans;
    while (int(line.size())) {
      if (int(line.size()) == 1) {
        ans.push_back(*line.begin());
        line.erase(line.begin());
      } else {
        pair<int, int> a = *line.begin();
        line.erase(line.begin());
        pair<int, int> b = *line.begin();
        line.erase(line.begin());
        ans.push_back(make_pair(a.first, b.first));
        line.insert(
            make_pair(min(a.second, b.second), max(a.second, b.second)));
      }
    }
    puts("YES");
    printf("%d\n", int(ans.size()));
    for (int i = 0; i < int(ans.size()); i++) {
      printf("%d %d\n", ans[i].first + 1, ans[i].second + 1);
    }
  }
}
int main() {
  read();
  solve();
}
