Given a directed graph of
Constraints
Input Specification
The first line of the input contains two space-separated integers,
Each of the next
You may assume that any given tuple
Output Specification
Output
On the YES
if it is still possible to reach vertex NO
otherwise.
Sample Input
Copy
3 3
1 2
2 1
2 3
Sample Output
Copy
NO
YES
NO
Comments