#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; vector< vector > P; vector A; vector B; void func( int a ) { B[a] = 1; for ( int i = 0; i < P[a].size(); i++ ) { int n = P[a][i]; if ( B[n] == 0 ) { func(n); } } } int main() { int N,M; cin >> N >> M; P.resize(N); A.resize(N,0); B.resize(N,0); int s; for ( int i = 0; i < M; i++ ) { int a,b; cin >> a >> b; P[a].push_back(b); P[b].push_back(a); A[a] = 1; A[b] = 1; s = a; } bool ans = true; func(s); for ( int i = 0; i < N; i++ ) { if ( A[i] != B[i] ) { ans = false; } } int a = 0; for ( int i = 0; i < N; i++ ) { if ( A[i] && P[i].size()%2 ) { a++; } } if ( !( a == 0 || a == 2 ) ) { ans = false; } cout << ( ans ? "YES" : "NO" ) << endl; return 0; }