Олимпиадный тренинг

Задача 33147. Banquet


Задача

Темы: Обход в глубину
N Very Important Persons (VVPs) were invited to the banquet. 2 tables were set up. The tables are large enough so that all banquet attendees can sit at any of them. The problem is that some OVPs don't get along with each other and can't sit at the same table. You have been asked to determine if it is possible for all OVPs to be seated at two tables.
 
Input: The first line of the input contains two numbers: N and M (1 <= N,M <= 100), where N – the number of ORP, and M – the number of OVP pairs that cannot sit at the same table. The next M lines contain 2 numbers – OVP couples who can't sit at the same table.
 
Output: If there is a way to seat OVP, then  print YES on the first line and the numbers of the OVPs you need to seat at the first table on the second line. Otherwise, in the first and only line print NO.

Examples
# Input Output
1
3 2
1 2
1 3
YES
1