#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long double ld; typedef long long ll; typedef vector vint; typedef pair pii; typedef pair pll; typedef pair pdd; typedef complex compd; #define rep(i,n) for(int i=0;i=0;i--) #define RREP(i,n) for(int i=n;i>=0;i--) #define all(a) (a).begin(),(a).end() #define mp(a,b) make_pair(a,b) #define mt make_tuple #define pb push_back #define fst first #define scn second #define bicnt(x) __buildin__popcount(x) #define debug(x) cout<<"debug: "<> n >> m; rep(i, m) { int a, b; cin >> a >> b; edge[a].push_back(b); edge[b].push_back(a); used[a] = used[b] = true; } rep(i, n) if (used[i]) { dfs(i); rep(j, n) if (used[j] && !visited[j]) { cout << "NO" << endl; return 0; } int cnt = 0; rep(j, n) if (edge[j].size() % 2) cnt++; if (cnt <= 2) cout << "YES" << endl; else cout << "NO" << endl; return 0; } }