eolymp
bolt
Try our new interface for solving problems

Loops

The adjacency matrix of an undirected graph is given. Determine whether it contains loops. \InputFile The first line contains the number of vertices $n~(1 \le n \le 100)$. Then given $n$ lines with $n$ elements in each --- the description of adjacency matrix. \OutputFile Print "\textbf{YES}" if graph contains loops and "\textbf{NO}" otherwise.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
0 1 1
1 0 1
1 1 0
Output example #1
NO
Input example #2
3
0 1 0
1 1 1
0 1 0
Output example #2
YES