#include <bits/stdc++.h>
int use[100], deg[100], p[100], ansx[10010], ansy[10010];
int findd(int x) {
  if (x == p[x]) return x;
  return p[x] = findd(p[x]);
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    memset(deg, 0, sizeof(deg));
    for (int i = 1; i <= n; i++) p[i] = i;
    for (int i = 0; i < m; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      deg[u]++;
      deg[v]++;
      p[findd(u)] = findd(v);
    }
    bool find = true;
    for (int i = 1; i <= n; i++)
      if (deg[i] > 2) find = false;
    if (!find) {
      puts("NO");
      continue;
    }
    int cnt = 0;
    memset(use, 0, sizeof(use));
    for (int i = 1; i <= n; i++) use[findd(i)] = 1;
    for (int i = 1; i <= n; i++)
      if (use[i]) cnt++;
    if (n == 1 && m == 1) {
      puts("YES\n0");
      continue;
    } else if (n == 1 && m == 0) {
      puts("YES\n1\n1 1");
      continue;
    } else if (n == 1) {
      puts("NO");
      continue;
    }
    int cntt = 0;
    for (int i = 1; i <= n && cnt > 1; i++) {
      for (int j = 1; j <= n && deg[i] < 2; j++) {
        if (findd(i) == findd(j)) continue;
        if (deg[j] >= 2) continue;
        deg[i]++;
        deg[j]++;
        ansx[cntt] = i;
        ansy[cntt] = j;
        cntt++;
        p[findd(i)] = findd(j);
        cnt--;
      }
    }
    for (int i = 1; i <= n; i++)
      if (deg[i] == 1)
        for (int j = i + 1; j <= n; j++) {
          if (deg[j] == 1) {
            ansx[cntt] = i;
            ansy[cntt] = j;
            cntt++;
            deg[i]++;
            deg[j]++;
            break;
          }
        }
    if (cnt != 1)
      puts("NO");
    else {
      bool find = true;
      for (int i = 1; i <= n; i++) {
        if (deg[i] != 2) find = false;
      }
      if (!find)
        puts("NO");
      else {
        puts("YES");
        printf("%d\n", cntt);
        for (int i = 0; i < cntt; i++) printf("%d %d\n", ansx[i], ansy[i]);
      }
    }
  }
  return 0;
}
