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 n employees, numbered 1 through n.
There are m known pairs (fi,si) 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 n employees can be split into two non-empty groups so that every employee belongs to exactly one group and no pair (fi,si) has both of its employees in the same group.