Given a directed graph of nodes,
edges, a node
, and a node
, print
YES
if it is possible to travel from to
even if any one edge is removed from the graph, and
NO
otherwise. If it is impossible to travel from to
, print
NO PATH
.
Input Specification
The first line will contain four integers,
.
The next lines will each two integers,
, indicating there is a path from
to
.
Output Specification
Print YES
if it is possible to travel from to
even if any one edge is removed from the graph, and
NO
otherwise. If it is impossible to travel from to
, print
NO PATH
.
Sample Input 1
4 5 2 3
1 2
2 3
3 1
1 4
4 1
Sample Output 1
NO
Sample Input 2
4 5 1 4
1 2
2 3
1 3
2 4
3 4
Sample Output 2
YES
Sample Input 3
3 1 1 2
1 3
Sample Output 3
NO PATH
Comments