#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; class UnionFind{ int n; vector data; public: UnionFind(int _n):n(_n),data(_n,-1){} bool link(int a, int b){ //if new link, then true. int ra=find_root(a); int rb=find_root(b); if(ra!=rb){ if(data[rb]> N >> M; vector v(N,0); UnionFind uf(N); int idx = 0; rep(i,M){ int a, b; cin >> a >> b; v[a]++; v[b]++; idx = a; uf.link(a,b); } bool flg = true; rep(i,v.size()){ if(v[i]>0 && !uf.check(idx,i)) flg = false; } int odd = 0; rep(i,v.size()){ if(v[i]%2==1) odd++; } if(flg && (odd == 0 || odd == 2)){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }