The Enemy of My Enemy

Decide whether the N people can be split into two camps so that every given hostile pair lands on opposite sides, which is exactly bipartiteness.

Medium4GraphBFSDFSUnion-findInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

Yongjae has made so many enemies over the years that he spends every day on edge. To prepare for an enemy who could show up at any moment, he decided to make friends. Becoming friends with someone he has no relationship with is hard, so he decided to use the theory that the enemy of my enemy is my friend.

The theory goes like this. If B is hostile to A and C is hostile to B, then A and C are friendly. The theory has a fatal drawback. If D is hostile to C, then A becomes hostile to D as well. And if E is hostile to D, then E turns out friendly with both A and C, and by the same reasoning B and D are friendly too.

Making friends this way also grows the list of enemies, but Yongjae needs friends badly. Nobody in the universe has ever proved the theory rigorously, so before he applies it he wants to check whether it can hold without contradiction among the NN people around him. The theory holds if the NN people can be split into two camps so that every given hostile pair is split across the two camps, and it fails if some hostile pair ends up inside one camp no matter how the split is made. Help Yongjae find out whether the theory can hold.

Input

The first line contains the number of people around Yongjae, NN (1N2,0001 \le N \le 2{,}000), and the number of hostile relations, MM (0M1,000,0000 \le M \le 1{,}000{,}000), separated by a space. Each of the next MM lines contains the numbers AA and BB (1A,BN1 \le A, B \le N) of two people who are hostile to each other.

Hostility has no direction. The same pair can be given several times, and a line where AA equals BB can be given as well.

Output

Print 11 on one line if the theory can hold, and 00 otherwise. If somebody is hostile to himself, the theory cannot hold.