Dr. Bill Poucher

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

There are nn people. Each person sees some of the other people. Each of them will be given a black or white hat. After that each person will simultaneously name a color. Everyone who doesn't guess the color on his hat will die. Horribly

Is there a deterministic strategy which guarantees that at least one person will survive?

입력

The first line contains two integers nn and mm (2n3105,1m31052 \leq n \leq 3 \cdot 10^5, 1 \leq m \leq 3 \cdot 10^5), the number of people and the number of relations of seeing someone (see below), respectively.

mm lines follow. ii-th of them contains two integers a_ia\_i and b_ib\_i (0a_i,b_i< n,a_ib_i0 \leq a\_i, b\_i <   n, a\_i \neq b\_i) meaning that a_ia\_i-th person sees b_ib\_i-th person. For all iji \neq j, a_ia_ja\_i \neq a\_j or b_ib_jb\_i \neq b\_j holds.

출력

Print 1 if there exists such strategy and 0 otherwise.