AT_abc404_c [ABC404C] Cycle Graph?

Description

You are given a simple undirected graph with $ N $ vertices and $ M $ edges. The vertices are numbered $ 1,2,\dots,N $ and the edges are numbered $ 1,2,\dots,M $ . Edge $ i $ connects vertices $ A_i $ and $ B_i $ . Determine whether this graph is a cycle graph. Definition of simple undirected graphA simple undirected graph is a graph with undirected edges without self-loops or multi-edges. Definition of cycle graphAn $ N $ -vertex graph with vertices labeled $ 1,2,\dots,N $ is a cycle graph when there exists a permutation $ (v_1,v_2,\dots,v_N) $ of $ (1,2,\dots,N) $ such that: - For each $ i = 1,2,\dots,N-1 $ , there is an edge between vertices $ v_i $ and $ v_{i+1} $ . \- There is an edge between vertices $ v_N $ and $ v_1 $ . \- No other edges exist.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ M $ $ A_1 $ $ B_1 $ $ \vdots $ $ A_M $ $ B_M $

Output Format

Output `Yes` if the given graph is a cycle graph; otherwise, print `No`.

Explanation/Hint

### Sample Explanation 1 The given graph is as follows, and this is a cycle graph. ![Figure](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc404_c/7613eb9304182da4189ca2b33ecc8e54ce9402d80ad7d6023b2dd915b35236c5.png) ### Sample Explanation 2 The given graph is as follows, and this is not a cycle graph. ![Figure](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc404_c/f62ed671fadfcc40f37f7d2c5aa124d523b30ff5415281af4b6c11b52b740dc6.png) ### Constraints - $ 3 \le N \le 2\times 10^5 $ - $ 0 \le M \le 2\times 10^5 $ - $ 1 \le A_i, B_i \le N $ - The given graph is simple. - All input values are integers.