func_code_string: #include <bits/stdc++.h>   using namespace std;   int used[100];   vector<vector<int>> g;   int cmp = 0;   vector<int> parent, rank1;   void make_set(int v) {     parent[v] = v;     rank1[v] = 0;   }   int find_set(int v) {     if (v == parent[v]) return v;     return parent[v] = find_set(parent[v]);   }   void union_sets(int a, int b) {     a = find_set(a);     b = find_set(b);     if (a != b) {       if (rank1[a] < rank1[b]) swap(a, b);       parent[b] = a;       if (rank1[a] == rank1[b]) ++rank1[a];     }   }   bool ok = 1;   void dfs(int v, int p = -1) {     used[v] = 1;     for (auto to : g[v]) {       if (!used[to])         union_sets(v, to), dfs(to, v);       else {         if (to != p) ok = 0;       }     }   }   signed main() {     ios_base::sync_with_stdio(0), cin.tie(0);     int n, m;     cin >> n >> m;     parent.resize(n);     rank1.resize(n);     for (int i = 0; i < n; ++i) make_set(i);     g.resize(n);     bool ok1 = 1, ok2 = 1, ok3 = 1;     bool ok4 = 1;     if (m > n) ok1 = 0;     for (int i = 0; i < m; ++i) {       int a, b;       cin >> a >> b;       a--, b--;       g[a].push_back(b);       g[b].push_back(a);       if (g[a].size() > 2 || g[b].size() > 2) {         ok2 = 0;       }     }     dfs(0);     for (int i = 0; i < n; ++i) {       if (!used[i]) ok3 = 0;       if (g[i].size() != 2) ok4 = 0;     }     if (ok4 && ok3) {       cout <<  YES  << endl << 0;       return 0;     }     memset(used, 0, sizeof(used));     for (int i = 0; i < n; ++i) {       if (!used[i]) dfs(i);     }     if (!(ok1 && ok2 && ok)) {       cout <<  NO ;       return 0;     }     vector<pair<int, int>> ans;     vector<int> cur;     vector<int> deg(n);     for (int i = 0; i < n; ++i) {       deg[i] = g[i].size();       if (deg[i] <= 1) cur.push_back(i);     }     for (int i = 0; i < n; ++i) {       if (!used[i]) {         dfs(i);         cmp++;       }     }     vector<int> nd;     for (int i = 0; i < n; ++i) {       for (int j = i + 1; j < n; ++j) {         if (deg[i] >= 2 || deg[j] >= 2) continue;         if (find_set(i) != find_set(j)) {           ans.push_back({i, j});           deg[i]++;           deg[j]++;           union_sets(i, j);         }       }     }     for (int i = 0; i < n; ++i) {       if (deg[i] <= 1) nd.push_back(i);     }     ans.push_back({nd[0], nd[nd.size() - 1]});     cout <<  YES n  << ans.size() <<   n ;     for (auto u : ans) cout << u.first + 1 <<     << u.second + 1 <<   n ;     return 0;   }   