League of Overwatch at Moloco (Hard)

Given n employees and m conflict pairs, decide whether the employees can be split into two non-empty groups so that no pair shares a group.

Medium4GraphDFSUnion-findNo attempts yetTime limit2sMemory limit512 MB

Problem

Every so often the employees of Moloco split into two groups and play a best-of-five series of League of Overwatch. Some pairs of employees are hardcore gamers who queued together as a duo in the past, so the company puts every such pair on opposite sides. The event stays enjoyable for newcomers only when it is not that competitive.

Moloco has nn employees, numbered 1 through nn.

There are mm known pairs (fi,si)(f_i, s_i) of employees who played a duo game together in the past. The two employees of a pair must belong to different groups at this event.

Decide whether the nn employees can be split into two non-empty groups so that every employee belongs to exactly one group and no pair (fi,si)(f_i, s_i) has both of its employees in the same group.

Input

The first line contains two integers nn and mm separated by a space (1n10000001 \le n \le 1\,000\,000, 1m10000001 \le m \le 1\,000\,000).

The ii-th of the next mm lines contains two integers fif_i and sis_i (1fi,sin1 \le f_i, s_i \le n). It is guaranteed that fisif_i \ne s_i for every ii. The same pair is given more than once in some inputs.

Output

Print one line containing POSSIBLE if such a split exists, and IMPOSSIBLE otherwise.

Hint

In the second example, the split {2} and {1, 3} satisfies every condition.