Flight Routes Check
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There are cities and flight connections. Your task is to check if you can travel from any city to any other city using the available flights.
Input
The first line has two integers and : the number of cities and flights. The cities are numbered .
After this, there are lines describing the flights. Each line has two integers and : there is a flight from city to city . All flights are one-way flights.
Output
Print "YES" if all routes are possible, and "NO" otherwise. In the latter case also print two cities and such that you cannot travel from city to city .
Examples
Input #1
Answer #1
Submissions 200
Acceptance rate 40%