#include <bits/stdc++.h>
using namespace std;
int cnt[55];
int color[55];
struct seg {
  int x, y;
} rec[55];
int ccc = 0;
bool cmp(seg a, seg b) {
  if (a.x != b.x)
    return a.x < b.x;
  else
    return a.y < b.y;
}
int exit() {
  cout << "NO" << endl;
  return 0;
}
int main() {
  int n, m;
  cin >> n >> m;
  int x, y;
  for (int i = 1; i <= n; i++) color[i] = i;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    cnt[x]++, cnt[y]++;
    int cx = color[x], cy = color[y];
    for (int i = 1; i <= n; i++) {
      if (color[i] == cy) color[i] = cx;
    }
  }
  bool flag = true;
  int s = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] >= 3) {
      flag = false;
      break;
    }
    s += cnt[i];
  }
  if (flag == false) return exit();
  flag = (n == m);
  for (int i = 2; i <= n; i++) {
    if (color[i] != color[i - 1] || cnt[i] != 2) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "YES" << endl << "0" << endl;
    return 0;
  }
  flag = true;
  for (int c = 1; c <= n; c++) {
    int cnt0 = 0, cnt1 = 0, cnt2 = 0;
    for (int i = 1; i <= n; i++)
      if (color[i] == c) {
        if (cnt[i] == 0) cnt0++;
        if (cnt[i] == 1) cnt1++;
        if (cnt[i] == 2) cnt2++;
      }
    if (!(cnt0 == 1 || cnt1 == 2 || cnt2 == 0)) {
      flag = false;
      break;
    }
  }
  if (flag == false) return exit();
  cout << "YES" << endl;
  cout << (2 * n - s) / 2 << endl;
  for (int k = 0; k < (2 * n - s) / 2 - 1; k++) {
    int c1 = 0, c2 = 0, id1, id2;
    for (int i = 1; i <= n; i++) {
      if (cnt[i] <= 1 && (!c1))
        c1 = color[i], id1 = i;
      else if (cnt[i] <= 1 && c1 && color[i] != c1) {
        c2 = color[i];
        id2 = i;
        break;
      }
    }
    cout << id1 << " " << id2 << endl;
    cnt[id1]++;
    cnt[id2]++;
    for (int i = 1; i <= n; i++)
      if (color[i] == c2) color[i] = c1;
  }
  int his = 0;
  for (int i = 1; i <= n; i++) {
    if (his == 0 && cnt[i] <= 1) {
      his = i;
      cnt[i]++;
    }
    if (his && cnt[i] <= 1) {
      cout << his << " " << i << endl;
      break;
    }
  }
  return 0;
}
