{"raw_statement":[{"iden":"problem statement","content":"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$.  \nEdge $i \\, (i = 1, 2, \\dots, M)$ connects vertices $u_i$ and $v_i$.\nDetermine if this graph is a path graph.\n\nWhat is a simple undirected graph? A **simple undirected graph** is a graph without self-loops or multiple edges whose edges do not have a direction.\n\nWhat is a path graph? A graph with $N$ vertices numbered $1, 2, \\dots, N$ is said to be a **path graph** if and only if there is a sequence $(v_1, v_2, \\dots, v_N)$ that is a permutation of $(1, 2, \\dots, N)$ and satisfies the following conditions:\n\n*   For all $i = 1, 2, \\dots, N-1$, there is an edge connecting vertices $v_i$ and $v_{i+1}$.\n*   If integers $i$ and $j$ satisfies $1 \\leq i, j \\leq N$ and $|i - j| \\geq 2$, then there is no edge that connects vertices $v_i$ and $v_j$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq M \\leq 2 \\times 10^5$\n*   $1 \\leq u_i, v_i \\leq N \\, (i = 1, 2, \\dots, M)$\n*   All values in the input are integers.\n*   The graph given in the input is simple."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$u_1$ $v_1$\n$u_2$ $v_2$\n$\\vdots$\n$u_M$ $v_M$"},{"iden":"sample input 1","content":"4 3\n1 3\n4 2\n3 2"},{"iden":"sample output 1","content":"Yes\n\nIllustrated below is the given graph, which is a path graph.\n![image](https://img.atcoder.jp/abc287/59d45566ae7f7fd4df9801eb0fdbea5f.png)"},{"iden":"sample input 2","content":"2 0"},{"iden":"sample output 2","content":"No\n\nIllustrated below is the given graph, which is not a path graph.\n![image](https://img.atcoder.jp/abc287/6c608de40ba7875deaf1aa168c7f8c83.png)"},{"iden":"sample input 3","content":"5 5\n1 2\n2 3\n3 4\n4 5\n5 1"},{"iden":"sample output 3","content":"No\n\nIllustrated below is the given graph, which is not a path graph.\n![image](https://img.atcoder.jp/abc287/73f11a6a7687f4e373da69426883e134.png)"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}