#include using namespace std; #define FOR(i, n) for(int i = 0; i < (n); i++) #define FORR(x, arr) for(auto& x:arr) #define ITR(x, c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define MEM(a, x) memset(a, x, sizeof(a)) #define ALL(a) a.begin(), a.end() #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) typedef long long ll; typedef pair P; int n, m; vector g[510]; template class UF { public: vector par,rank,cnt; UF() {par=rank=vector(um,0); cnt=vector(um,1); for(int i=0;irank[y]) return par[x]=y; rank[x]+=rank[x]==rank[y]; return par[y]=x; } }; UF<510> uf; int main(int argc, char const *argv[]) { ios_base::sync_with_stdio(false); cin >> n >> m; set st; FOR(i, m) { int a, b; cin >> a >> b; g[a].push_back(b); g[b].push_back(a); st.insert(a); st.insert(b); uf(a, b); } int cnt = 0; FOR(i, n) { if (g[i].size() & 1) cnt++; } FOR(i, n) { if (uf.count(i)!=1 && uf.count(i)!=st.size()) cnt = -1; } cout << (cnt==0 || cnt==2 ? "YES" : "NO") << endl; return 0; }