Flight routes check#10996

Flight routes check

1 second
128 megabytes
Easy

There are cities and flights. Your task is to determine whether it is possible, using the available flights, to travel from any city to any other city.

Input

The first line contains two integers and — the number of cities and flights. The cities are numbered with integers 1, 2, \ldots, n.

The next lines describe the flights. Each line contains two integers and , meaning that there is a flight from city to city . All flights are one-way.

Output

Print "YES" if all routes are possible, and "NO" otherwise. In the latter case, also print two cities and such that it is impossible to travel from to .

Examples

Example 1

Loading
Loading