#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535897932384626433832795;
const double eps = 1e-12;
const int INF = 1 << 30;
const long long LINF = 1ll << 60;
const int BUFFER_SZ = 1 << 10;
const int MOD = 1000 * 1000 * 1000 + 7;
char BUFFER[BUFFER_SZ];
int gi() {
  int x;
  scanf("%d", &x);
  return x;
}
double gd() {
  double x;
  scanf("%lf", &x);
  return x;
}
long long gll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
vector<int> gvi(int n) {
  vector<int> a;
  while (n-- > 0) a.push_back(gi());
  return a;
}
string gs() {
  scanf("%s", BUFFER);
  return string(BUFFER);
}
template <class T>
void print(vector<T> &x, string format) {
  format += "%c";
  for (int i = 0; i < x.size(); ++i)
    printf(format.c_str(), x[i], i + 1 == x.size() ? '\n' : ' ');
}
int P[64], N, CN;
int PClosed[64];
pair<int, int> lines[64];
int join(int a, int b) {
  int aa = P[a];
  int bb = P[b];
  if (PClosed[aa]) return 0;
  if (PClosed[bb]) return 0;
  if (aa == bb) {
    if (CN != 1) return 0;
    if (lines[aa] == make_pair(a, b) || lines[aa] == make_pair(b, a)) {
      PClosed[aa] = 1;
      return 1;
    }
    return 0;
  }
  if (lines[aa].first != a && lines[aa].second != a) return 0;
  if (lines[bb].first != b && lines[bb].second != b) return 0;
  if (lines[aa].first == a) swap(lines[aa].first, lines[aa].second);
  if (lines[bb].second == b) swap(lines[bb].first, lines[bb].second);
  for (int i = 0; i < N; ++i) {
    if (P[i] == aa) P[i] = bb;
  }
  lines[bb] = make_pair(lines[aa].first, lines[bb].second);
  CN--;
  return 1;
}
void solve() {
  int n = gi();
  int m = gi();
  N = n;
  CN = N;
  for (int i = 0; i < n; ++i) {
    P[i] = i;
    PClosed[i] = 0;
    lines[i] = {i, i};
  }
  for (int i = 0; i < m; ++i) {
    int a = gi() - 1;
    int b = gi() - 1;
    if (!join(a, b)) {
      printf("NO\n");
      return;
    }
  }
  vector<pair<int, int> > r;
  for (int a = 0; a < n; ++a) {
    for (int b = a; b < n; ++b) {
      if (join(a, b)) {
        r.push_back(make_pair(a, b));
      }
      if (join(a, b)) {
        r.push_back(make_pair(a, b));
      }
    }
  }
  printf("YES\n%d\n", r.size());
  for (auto x : r) printf("%d %d\n", x.first + 1, x.second + 1);
}
int main() {
  solve();
  return 0;
}
