#include #include #include using namespace std; int visited[500]; vector G[500]; void dfs(int v) { visited[v] = true; for (int to : G[v]) { if (not visited[to]) dfs(to); } } int main() { int N, M; cin >> N >> M; vector deg(N, 0); memset(visited, -1, sizeof(visited)); int a, b; for (int i = 0; i < M; i++) { cin >> a >> b; deg[a]++; deg[b]++; visited[a] = visited[b] = 0; G[a].push_back(b); G[b].push_back(a); } dfs(a); for (int i = 0; i < N; i++) { if (visited[i] == 0) { cout << "NO" << endl; return 0; } } int cnt = 0; for (int i = 0; i < N; i++) { cnt += deg[i] & 1; } if (cnt <= 2) cout << "YES" << endl; else cout << "NO" << endl; return 0; }