#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using P = pair; constexpr int INF = 1001001001; constexpr int mod = 1000000007; // constexpr int mod = 998244353; template inline bool chmax(T& x, T y){ if(x < y){ x = y; return true; } return false; } template inline bool chmin(T& x, T y){ if(x > y){ x = y; return true; } return false; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; vector> graph(N); for(int i = 0; i < M; ++i){ int u, v; cin >> u >> v; graph[u].emplace_back(v, i); graph[v].emplace_back(u, i); } for(int s = 0; s < N; ++s){ auto g = graph; int cnt = 0; vector used(M); queue que; int v = s; bool update = true; while(update){ update = false; int n = g[v].size(); for(int i = n - 1; i >= 0; --i){ auto [u, j] = graph[v][i]; if(used[j]) g[v].pop_back(); else{ cnt += 1; used[j] = true; g[v].pop_back(); v = u; update = true; break; } } } if(cnt == M){ cout << "YES\n"; return 0; } } cout << "NO\n"; return 0; }