{"problem":{"name":"Neighbors","description":{"content":"Determine whether there is a way to line up $N$ people, numbered $1$ to $N$, in a row side by side to satisfy all of the $M$ conditions in the following format. *   Condition: Person $A_i$ and Person","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc231_d"},"statements":[{"statement_type":"Markdown","content":"Determine whether there is a way to line up $N$ people, numbered $1$ to $N$, in a row side by side to satisfy all of the $M$ conditions in the following format.\n\n*   Condition: Person $A_i$ and Person $B_i$ are adjacent.\n\n## Constraints\n\n*   $2 \\leq N \\leq 10^5$\n*   $0 \\leq M \\leq 10^5$\n*   $1\\leq A_i < B_i \\leq N$\n*   All pairs $(A_i,B_i)$ are distinct.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $B_1$\n$\\vdots$\n$A_M$ $B_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc231_d","tags":[],"sample_group":[["4 2\n1 3\n2 3","Yes\n\nOne way to satisfy all the conditions is to line them up in the order $4,1,3,2$."],["4 3\n1 4\n2 4\n3 4","No\n\nThere is no way to line them up to satisfy all the conditions."]],"created_at":"2026-03-03 11:01:14"}}