#include <bits/stdc++.h>
using namespace std;
int n, m, a, b;
int deg[55], root[55];
pair<int, int> p;
vector<pair<int, int> > ans;
int find_root(int h) {
  return (h == root[h]) ? h : (root[h] = find_root(root[h]));
}
int main() {
  scanf("%d %d", &n, &m);
  if (n == 1) {
    if (m == 0)
      puts("YES\n1\n1 1");
    else if (m == 1)
      puts("YES\n0");
    else
      puts("NO");
    return 0;
  }
  for (int i = 1; i <= n; i++) root[i] = i;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &a, &b);
    deg[a]++, deg[b]++;
    int x = find_root(a), y = find_root(b);
    if (x == y) {
      if (i < m) {
        puts("NO");
        return 0;
      } else {
        bool bad = 0;
        for (int j = 1; j <= n; j++) {
          int z = find_root(j);
          if (z != x) bad = 1;
        }
        if (bad) {
          puts("NO");
          return 0;
        } else {
          puts("YES\n0");
          return 0;
        }
      }
    }
    root[x] = y;
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] > 2) {
      puts("NO");
      return 0;
    }
  }
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      for (int step = 0; step < 2; step++) {
        if (deg[i] >= 2) break;
        if (deg[j] == 2) continue;
        int x = find_root(i), y = find_root(j);
        if (x != y)
          p.first = i, p.second = j, ans.push_back(p), deg[i]++, deg[j]++,
          root[x] = y;
        else {
          bool bad = 0;
          for (int k = 1; k <= n; k++) {
            int z = find_root(k);
            if (z != x) {
              bad = 1;
              break;
            }
          }
          if (bad)
            continue;
          else {
            p.first = i, p.second = j, ans.push_back(p);
            deg[i]++, deg[j]++;
            puts("YES");
            printf("%d\n", ans.size());
            for (int k = 0; k < ans.size(); k++)
              printf("%d %d\n", ans[k].first, ans[k].second);
            return 0;
          }
        }
      }
    }
  }
  puts("YES");
  printf("%d\n", ans.size());
  for (int k = 0; k < ans.size(); k++)
    printf("%d %d\n", ans[k].first, ans[k].second);
  return 0;
}
