#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX / 2, NINF = INT_MIN / 2;
const long double PI = acos(-1.0);
void prepareIO() {
  if (strlen("") != 0) {
    freopen(
        ""
        ".in",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
}
void debout() {}
template <typename Head, typename... Tail>
void debout(Head H, Tail... T) {}
class Timer {
 public:
  double begin;
  Timer() : begin(clock()) {}
  ~Timer() {
    fprintf(stderr, "%.6lf\n", (clock() - begin + .0) / CLOCKS_PER_SEC);
  }
} timer_;
void solve1();
int main() {
  prepareIO();
  solve1();
  return 0;
}
const int N = 100;
int marker[N], deg[N];
vector<int> E[N];
int Parent[N];
int get_parent(int vertex) {
  return Parent[vertex] == vertex ? vertex
                                  : Parent[vertex] = get_parent(Parent[vertex]);
}
void Unite(int a, int b) {
  a = get_parent(a);
  b = get_parent(b);
  Parent[b] = a;
}
bool dfs(int ver, int col, int par = -1) {
  if (marker[ver] != -1) {
    return true;
  }
  marker[ver] = col;
  Unite(ver, col);
  for (auto elem : E[ver]) {
    if (elem == par) {
      continue;
    }
    if (dfs(elem, col, ver)) {
      return true;
    }
  }
  return false;
}
void solve1() {
  int n, m;
  scanf("%d %d", &n, &m);
  if (m > n) {
    printf("NO\n");
    return;
  }
  if (n == 1) {
    if (m > 2) {
      printf("NO\n");
      return;
    }
    printf("YES\n");
    printf("%d\n", n - m);
    if (n - m) {
      printf("1 1\n");
    }
    return;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    deg[a]++;
    deg[b]++;
    if (deg[a] > 2 || deg[b] > 2) {
      printf("NO\n");
      return;
    }
    E[a].push_back(b);
    E[b].push_back(a);
  }
  fill(marker, marker + N, -1);
  if (n == m) {
    dfs(0, 0);
    int flag = 1;
    for (int i = 0; i < n; i++) {
      flag &= marker[i] != -1 && deg[i] == 2;
    }
    if (flag) {
      printf("YES\n0\n");
    } else {
      printf("NO\n");
    }
    return;
  }
  for (int i = 0; i < N; i++) {
    Parent[i] = i;
  }
  for (int i = 0; i < n; i++) {
    if (marker[i] == -1 && dfs(i, i)) {
      printf("NO\n");
      return;
    }
  }
  vector<pair<int, int>> ans;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (get_parent(i) != get_parent(j) && deg[i] < 2 && deg[j] < 2) {
        Unite(i, j);
        ans.push_back({i, j});
        deg[i]++;
        deg[j]++;
      }
    }
  }
  int a[2], cnt = 0;
  for (int i = 0; i < n; i++) {
    if (deg[i] == 1) {
      a[cnt++] = i;
    }
  }
  assert(cnt == 2);
  ans.push_back({a[0], a[1]});
  printf("YES\n");
  printf("%d\n", (int)ans.size());
  for (auto elem : ans) {
    printf("%d %d\n", elem.first + 1, elem.second + 1);
  }
}
