#include #include #include using namespace std; const int N = 510; int t, n, m, d[N], fa[N]; int Find(int x) { return fa[x] ? fa[x] = Find(fa[x]) : x; } int main() { scanf("%d%d", &n, &m); memset(d, 0, sizeof(d)); for (int i = 1, u, v; i <= m; ++i) { scanf("%d%d", &u, &v); ++d[u], ++d[v]; int fu = Find(u), fv = Find(v); if (fu != fv) fa[fu] = fv; } int root = -1, odd = 0; for (int i = 0; i < n; ++i) { if (!d[i]) continue; if (root == -1) root = Find(i); else if (Find(i) != root) { puts("NO"); break; } odd += d[i] & 1; } puts(odd == 0 || odd == 2 ? "YES" : "NO"); return 0; }