#include #include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m, r; cin >> n >> m; vector cnt(n); atcoder::dsu uf(n); for(int i = 0; i < m; i++){ int u, v; cin >> u >> v; r = u; uf.merge(u, v); cnt[u]++, cnt[v]++; } cout << (count_if(cnt.begin(), cnt.end(), [&](int v){return (v & 1);}) <= 2 && uf.size(r) == count_if(cnt.begin(), cnt.end(), [&](int v){return v >= 1;}) ? "YES" : "NO") << '\n'; }