Given a directed graph of vertices and
edges, determine for each edge if it
is possible to reach vertex
from vertex
given that that edge is deleted
from the graph.
Constraints
Input Specification
The first line of the input contains two space-separated integers, and
.
Each of the next lines contains two space-separated integers,
and
, indicating that the
th
edge goes from vertex
to
.
You may assume that any given tuple appears at most once.
Output Specification
Output lines.
On the th line, given that the
th edge is deleted,
print
YES
if it is still possible to reach vertex from vertex
. Print
NO
otherwise.
Sample Input
3 3
1 2
2 1
2 3
Sample Output
NO
YES
NO
Comments