No way to regret
#描述#
Last year, AngryHair made a serious mistake during the contest in Jilin. There was a simple problem which could be solved by matching. But the programmer didn’t realize that our template can only be used for Bipartite matching problem, and the graph constructed by the programmer is not a Bipartite Graph, which lead to WA.
After that, AngryHair decided to write a program to judge whether a graph is a bipartite one.
A bipartite graph, also called a bigraph, is a set of graph vertices decomposed into two disjoint sets such that no two vertices within the same set are adjacent.
#格式#
##输入格式##
The input contains multiple test cases.
For each test case, it contains n+1 lines.
Line 1: two integers m, n (1<= m <= 10000, 0 <= n <= 100000) indicating that there are m vertices and n edges in the graph.
Line 2~n+1: each contains two integers i, j (1 <= i, j <= m), indicating that there is an edge between vertex i and vertex j.
##输出格式##
If the graph is a bipartite one, output “Yes”, else output “No”.
#样例1#
##样例输入1##
3 3
1 2
2 3
1 3
4 2
1 2
3 4
##样例输出1##
No
Yes
#限制#
1000ms
32768KB
#提示#
#来源#
lily