#include #include #include #include #include #include #include using namespace std; int n, m, a, b, d[509], par[509]; int root(int x) { return x == par[x] ? x : par[x] = root(par[x]); } int main() { cin >> n >> m; for (int i = 0; i < n; i++) par[i] = i; for (int i = 0; i < m; i++) { cin >> a >> b; d[a]++; d[b]++; par[root(a)] = root(b); } vector s; for (int i = 0; i < n; i++) { if (d[i] >= 1) s.push_back(root(i)); } sort(s.begin(), s.end()); bool ret = true; for (int i = 1; i < s.size(); i++) { if (s[i - 1] != s[i]) ret = false; } int cnt = 0; for (int i = 0; i < n; i++) { if (d[i] % 2 == 1) cnt++; } cout << (cnt >= 3 || !ret ? "NO" : "YES") << endl; return 0; }