A directed graph is called transitive if, for any three distinct vertices , , and , whenever there are edges from to and from to , there is also an edge from to .
Check whether the given directed graph is transitive.
The first line contains the number of vertices (1 \le n \le 100) in the graph. The next lines contain the adjacency matrix of the graph.
Output "YES" if the graph is transitive, and "NO" otherwise.
1-nji mysal