{"raw_statement":[{"iden":"problem statement","content":"You are given an undirected graph with $N$ vertices numbered $1$ to $N$ and $M$ edges numbered $1$ to $M$. Edge $i$ connects vertex $u_i$ and vertex $v_i$.\nDetermine whether every connected component in this graph satisfies the following condition.\n\n*   The connected component has the same number of vertices and edges."},{"iden":"notes","content":"An **undirected graph** is a graph with edges without direction.  \nA **subgraph** of a graph is a graph formed from a subset of vertices and edges of that graph.  \nA graph is **connected** when one can travel between every pair of vertices in the graph via edges.  \nA **connected component** is a connected subgraph that is not part of any larger connected subgraph."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq M \\leq 2 \\times 10^5$\n*   $1 \\leq u_i \\leq v_i \\leq N$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$u_1$ $v_1$\n$\\vdots$\n$u_M$ $v_M$"},{"iden":"sample input 1","content":"3 3\n2 3\n1 1\n2 3"},{"iden":"sample output 1","content":"Yes\n\nThe graph has a connected component formed from just vertex $1$, and another formed from vertices $2$ and $3$.  \nThe former has one edge (edge $2$), and the latter has two edges (edges $1$ and $3$), satisfying the condition."},{"iden":"sample input 2","content":"5 5\n1 2\n2 3\n3 4\n3 5\n1 5"},{"iden":"sample output 2","content":"Yes"},{"iden":"sample input 3","content":"13 16\n7 9\n7 11\n3 8\n1 13\n11 11\n6 11\n8 13\n2 11\n3 3\n8 12\n9 11\n1 11\n5 13\n3 12\n6 9\n1 10"},{"iden":"sample output 3","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}