#include #define rep(i,a,b) for(int i=a;i=b;i--) #define fore(i,a) for(auto &i:a) #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } //--------------------------------------------------------------------------------------------------- struct UnionFind {vector par, cnt; UnionFind(int NV) { par.clear(); cnt.resize(NV, 1); rep(i, 0, NV) par.push_back(i); } void reset() { rep(i, 0, cnt.size()) cnt[i] = 1; rep(i, 0, par.size()) par[i] = i; } int operator[](int x) { return par[x] == x ? x : par[x] = operator[](par[x]); } void operator()(int x, int y) {x = operator[](x); y = operator[](y); if (x != y) par[x] = y, cnt[y] += cnt[x];}}; /*---------------------------------------------------------------------------------------------------             ∧_∧       ∧_∧  (´<_` )  Welcome to My Coding Space!      ( ´_ゝ`) /  ⌒i     /   \    | |     /   / ̄ ̄ ̄ ̄/  |   __(__ニつ/  _/ .| .|____      \/____/ (u ⊃ ---------------------------------------------------------------------------------------------------*/ int N, M; vector E[505]; int vis[505]; //--------------------------------------------------------------------------------------------------- void _main() { cin >> N >> M; UnionFind uf(N); rep(i, 0, M) { int a, b; cin >> a >> b; E[a].push_back(b); E[b].push_back(a); uf(a, b); vis[a] = vis[b] = 1; } map cnt; rep(i, 0, N) cnt[E[i].size() % 2]++; int ok = 1; int c = 0; rep(i, 0, N) if (vis[i]) c = i; rep(i, 0, N) if (vis[i] and uf[c] != uf[i]) ok = 0; if (ok and (cnt[1] == 0 or cnt[1] == 2)) printf("YES\n"); else printf("NO\n"); }