#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using P = pair; constexpr int INF = 1001001001; constexpr int mod = 1000000007; // constexpr int mod = 998244353; template inline bool chmax(T& x, T y){ if(x < y){ x = y; return true; } return false; } template inline bool chmin(T& x, T y){ if(x > y){ x = y; return true; } return false; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; vector> graph(N); for(int i = 0; i < M; ++i){ int u, v; cin >> u >> v; graph[u].emplace_back(v); graph[v].emplace_back(u); } int s = 0; for(int i = 0; i < N; ++i){ if(graph[i].size()){ s = i; break; } } queue que; que.emplace(s); vector used(N); used[s] = true; int edge_cnt = 0; while(!que.empty()){ int from = que.front(); que.pop(); for(int to : graph[from]){ if(!used[to]){ used[to] = true; edge_cnt += 1; que.emplace(to); } } } cout << edge_cnt << endl; if(edge_cnt != M){ cout << "NO\n"; return 0; } int cnt = 0; for(int i = 0; i < N; ++i) cnt += graph[i].size() % 2; if(cnt == 2) cout << "YES\n"; else cout << "NO\n"; return 0; }