#include <bits/stdc++.h>
using namespace std;
vector<int> e[55];
int n, m;
bool v[55];
vector<pair<int, int> > ans;
bool check[55][55];
int num[55];
void cc(int x, int c) {
  num[x] = c;
  for (int i = 0; i < e[x].size(); i++)
    if (num[e[x][i]] < c) cc(e[x][i], c);
}
bool can() {
  int cnt = 0;
  for (int i = 1; i <= n; i++) num[i] = 0;
  for (int i = 1; i <= n; i++) {
    if (num[i] == 0) {
      cc(i, ++cnt);
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (num[i] != num[j] && e[i].size() < 2 && e[j].size() < 2)
        if (!check[i][j]) {
          e[i].push_back(j);
          e[j].push_back(i);
          ans.push_back(pair<int, int>(i, j));
          check[i][j] = true;
          return true;
        }
    }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (e[i].size() < 2 && e[j].size() < 2)
        if (!check[i][j]) {
          e[i].push_back(j);
          e[j].push_back(i);
          ans.push_back(pair<int, int>(i, j));
          check[i][j] = true;
          return true;
        }
    }
  return false;
}
bool is_connected() {
  int cnt = 1;
  queue<int> q;
  q.push(1);
  v[1] = true;
  while (q.size()) {
    int now = q.front();
    q.pop();
    for (int i = 0; i < e[now].size(); i++) {
      if (!v[e[now][i]]) {
        q.push(e[now][i]);
        v[e[now][i]] = true;
        cnt++;
      }
    }
  }
  if (cnt == n) return true;
  return false;
}
bool is_has_deg2() {
  for (int i = 1; i <= n; i++)
    if (e[i].size() != 2) return false;
  return true;
}
bool go(int x, int p) {
  v[x] = true;
  bool ret = false;
  for (int i = 0; i < e[x].size(); i++) {
    if (v[e[x][i]] && e[x][i] != p) return true;
    if (!v[e[x][i]]) {
      ret |= go(e[x][i], x);
    }
  }
  return ret;
}
bool no_cycle() {
  for (int i = 1; i <= n; i++) v[i] = false;
  for (int i = 1; i <= n; i++)
    if (!v[i]) {
      if (go(i, -1)) return false;
    }
  return true;
}
bool deg_less2() {
  for (int i = 1; i <= n; i++)
    if (e[i].size() > 2) return false;
  return true;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    if (a == b && n != 1) {
      printf("NO\n");
      return 0;
    }
    if (!check[a][b]) {
      e[a].push_back(b);
      e[b].push_back(a);
      check[a][b] = true;
      check[b][a] = true;
    } else if (n != 2) {
      printf("NO\n");
      return 0;
    }
  }
  if (n == 1) {
    if (m == 1) {
      printf("YES\n0\n");
      return 0;
    } else if (m == 0) {
      printf("YES\n1\n1 1\n");
      return 0;
    }
  } else if (n == 2) {
    if (m == 0) {
      printf("YES\n2\n1 2\n1 2\n");
      return 0;
    } else if (m == 1) {
      if (check[1][1])
        printf("YES\n1\n2 2\n");
      else if (check[1][2])
        printf("YES\n1\n1 2\n");
      else if (check[2][2])
        printf("YES\n1\n1 1\n");
      else
        printf("YESn\0\n");
    } else if (m == 2) {
      if (check[1][1] && check[1][2] && !check[2][2])
        printf("YES\n1\n2 2\n");
      else if (check[1][1] && !check[1][2] && !check[2][2])
        printf("YES\n1\n2 2\n");
      else if (!check[1][1] && check[1][2] && check[2][2])
        printf("YES\n1\n1 1\n");
      else if (!check[1][1] && !check[1][2] && check[2][2])
        printf("YES\n1\n1 1\n");
      else
        printf("YES\n0\n");
    }
  } else if (is_connected() && is_has_deg2()) {
    printf("YES\n0\n");
    return 0;
  } else if (m < n && no_cycle() && deg_less2()) {
    printf("YES\n%d\n", n - m);
    while (can())
      ;
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++)
      printf("%d %d\n", ans[i].first, ans[i].second);
  } else
    printf("NO\n");
  return 0;
}
